summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/layout')
-rw-r--r--src/main/java/com/amazon/carbonado/layout/LayoutFactory.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/com/amazon/carbonado/layout/LayoutFactory.java b/src/main/java/com/amazon/carbonado/layout/LayoutFactory.java
index c4333da..9788739 100644
--- a/src/main/java/com/amazon/carbonado/layout/LayoutFactory.java
+++ b/src/main/java/com/amazon/carbonado/layout/LayoutFactory.java
@@ -148,6 +148,7 @@ public class LayoutFactory implements LayoutCapability {
private Layout layout;
private FetchException fetchEx;
private PersistException persistEx;
+ private RuntimeException runtimeEx;
public synchronized void run() {
try {
@@ -157,6 +158,11 @@ public class LayoutFactory implements LayoutCapability {
fetchEx = e;
} catch (PersistException e) {
persistEx = e;
+ } catch (RuntimeException e) {
+ // This is a catchall for any other exception which
+ // might happen so that it doesn't get absorbed by
+ // this thread.
+ runtimeEx = e;
}
} finally {
done = true;
@@ -178,6 +184,10 @@ public class LayoutFactory implements LayoutCapability {
// Wrap to get complete stack trace.
throw new PersistException(persistEx);
}
+ if (runtimeEx != null) {
+ // Wrap to get complete stack trace.
+ throw new RuntimeException(runtimeEx);
+ }
return layout;
}
}
@@ -303,7 +313,7 @@ public class LayoutFactory implements LayoutCapability {
}
throw e;
} catch (PersistException e) {
- if (e instanceof PersistDeadlockException || e instanceof PersistTimeoutException){
+ if (e instanceof PersistDeadlockException || e instanceof PersistTimeoutException) {
// Might be caused by coarse locks. Switch to nested
// transaction to share the locks.
if (top) {