diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/spi')
-rw-r--r-- | src/main/java/com/amazon/carbonado/spi/TransactionManager.java | 2 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/spi/TransactionScope.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/spi/TransactionManager.java b/src/main/java/com/amazon/carbonado/spi/TransactionManager.java index a63784a..48f52af 100644 --- a/src/main/java/com/amazon/carbonado/spi/TransactionManager.java +++ b/src/main/java/com/amazon/carbonado/spi/TransactionManager.java @@ -88,7 +88,7 @@ public abstract class TransactionManager<Txn> { // Called by TransactionScope.
boolean removeLocalScope(TransactionScope<Txn> scope) {
TransactionScope<Txn> existing = mLocalScope.get();
- if (existing == null || existing == scope) {
+ if (existing == scope) {
mLocalScope.remove();
return true;
}
diff --git a/src/main/java/com/amazon/carbonado/spi/TransactionScope.java b/src/main/java/com/amazon/carbonado/spi/TransactionScope.java index 60e5f84..bce7804 100644 --- a/src/main/java/com/amazon/carbonado/spi/TransactionScope.java +++ b/src/main/java/com/amazon/carbonado/spi/TransactionScope.java @@ -236,7 +236,7 @@ public class TransactionScope<Txn> { void detach() {
mLock.lock();
try {
- if (mTxnMgr.removeLocalScope(this)) {
+ if (mDetached || mTxnMgr.removeLocalScope(this)) {
mDetached = true;
} else {
throw new IllegalStateException("Transaction is attached to a different thread");
|