summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/amazon/carbonado/txn/TransactionScope.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/txn/TransactionScope.java b/src/main/java/com/amazon/carbonado/txn/TransactionScope.java
index 61f4b6a..8bad678 100644
--- a/src/main/java/com/amazon/carbonado/txn/TransactionScope.java
+++ b/src/main/java/com/amazon/carbonado/txn/TransactionScope.java
@@ -196,6 +196,7 @@ public class TransactionScope<Txn> {
/**
* Returns the implementation for the active transaction, only if it exists.
+ * (does not create a transaction like getTxn()
*/
Txn getActiveTxn() {
mLock.lock();
@@ -371,6 +372,11 @@ public class TransactionScope<Txn> {
mTxn = null;
}
} catch (Throwable e) {
+ try {
+ scope.mTxnMgr.abortTxn(mTxn);
+ } catch (Throwable e2) {
+ // Ignore. At least we tried to clean up.
+ }
mTxn = null;
throw ExceptionTransformer.getInstance().toPersistException(e);
}