diff options
| author | Alex Rudyy <orudyy@apache.org> | 2014-08-28 15:00:06 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2014-08-28 15:00:06 +0000 |
| commit | e6a075f7373351710e320ae385beaf68ae404300 (patch) | |
| tree | 0e0b8866df642b942328a04c7e5317f3d69878ea /qpid/java/broker-core/src | |
| parent | 64f8ac4fd226e9201fad685efea5a3332a30e262 (diff) | |
| download | qpid-python-e6a075f7373351710e320ae385beaf68ae404300.tar.gz | |
QPID-6051: Allow exceptions from post commit actions to be handled in the callers
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1621146 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-core/src')
| -rwxr-xr-x | qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java | 62 |
1 files changed, 7 insertions, 55 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java index f5d32d2e20..349ec793fe 100755 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/txn/LocalTransaction.java @@ -24,8 +24,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.apache.qpid.server.util.ConnectionScopedRuntimeException; -import org.apache.qpid.transport.TransportException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -259,11 +257,6 @@ public class LocalTransaction implements ServerTransaction doPostTransactionActions(); } - catch(RuntimeException e) - { - doRollbackActions(); - throw e; - } finally { resetDetails(); @@ -282,11 +275,9 @@ public class LocalTransaction implements ServerTransaction { sync(); StoreFuture future = StoreFuture.IMMEDIATE_FUTURE; - try + if(_transaction != null) { - if(_transaction != null) - { - future = new StoreFuture() + future = new StoreFuture() { private volatile boolean _completed = false; private StoreFuture _underlying = _transaction.commitTranAsync(); @@ -325,21 +316,16 @@ public class LocalTransaction implements ServerTransaction doPostTransactionActions(); deferred.run(); } - catch (RuntimeException e) - { - handleUnexpectedException(e); - } finally { resetDetails(); } } - - }; - _asyncTran = future; - } - else - { + }; + _asyncTran = future; + } + else + { try { doPostTransactionActions(); @@ -349,44 +335,10 @@ public class LocalTransaction implements ServerTransaction { resetDetails(); } - } - - } - catch (RuntimeException e) - { - try - { - handleUnexpectedException(e); - } - finally - { - resetDetails(); - } } return future; } - private void handleUnexpectedException(RuntimeException e) - { - if(e instanceof ConnectionScopedRuntimeException || e instanceof TransportException) - { - throw e; - } - else - { - _logger.error("Unexpected exception on execution of post commit deferred actions", e); - boolean continueOnError = Boolean.getBoolean("qpid.broker.exceptionHandler.continue"); - if (continueOnError) - { - throw e; - } - else - { - Runtime.getRuntime().halt(1); - } - } - } - private void doPostTransactionActions() { if(_logger.isDebugEnabled()) |
