diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2013-10-25 01:36:27 +0000 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2013-10-25 01:36:27 +0000 |
commit | bcfaaffa3751f8c7883e41c162ba4030fd9bd21a (patch) | |
tree | 7e2416a6ec9d3733a20e45e7028bf60410ac7504 /src/main/java/com/amazon/carbonado/layout | |
parent | 1a6cb41e1db610d6cea249b5b33ad65cfd945b2f (diff) |
Fixing ReplicatedRepository so that transactions may be entered when the master
is unavailable as long as no changes are made to replicated storables.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/layout')
-rw-r--r-- | src/main/java/com/amazon/carbonado/layout/LayoutFactory.java | 12 |
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) {
|