This is an automated email from the ASF dual-hosted git repository.

eshu11 pushed a commit to branch feature/GEODE-5376
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 882f177631921501131ac7dd243db4ecabccf94f
Author: eshu <[email protected]>
AuthorDate: Tue Jul 10 17:14:36 2018 -0700

    do not abort when beforeCompletion failed, only do it in afterCompletion.
---
 .../src/main/java/org/apache/geode/internal/cache/TXState.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
index 30df42b..090d155 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
@@ -863,6 +863,10 @@ public class TXState implements TXStateInterface {
   }
 
   protected void cleanup() {
+    cleanup(false);
+  }
+
+  protected void cleanup(boolean isBeforeCompletion) {
     IllegalArgumentException iae = null;
     try {
       this.closed = true;
@@ -916,7 +920,7 @@ public class TXState implements TXStateInterface {
       synchronized (this.completionGuard) {
         this.completionGuard.notifyAll();
       }
-      if (this.syncRunnable != null) {
+      if (this.syncRunnable != null && !isBeforeCompletion) {
         this.syncRunnable.abort();
       }
       if (iae != null && !this.proxy.getCache().isClosed()) {
@@ -1093,7 +1097,7 @@ public class TXState implements TXStateInterface {
         }
       }
     } catch (CommitConflictException commitConflict) {
-      cleanup();
+      cleanup(true);
       proxy.getTxMgr().noteCommitFailure(opStart, this.jtaLifeTime, this);
       beforeCompletionException = new SynchronizationCommitConflictException(
           LocalizedStrings.TXState_CONFLICT_DETECTED_IN_GEMFIRE_TRANSACTION_0

Reply via email to