jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cko...@apache.org
Subject svn commit: r1202144 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XASessionImpl.java
Date Tue, 15 Nov 2011 11:56:52 GMT
Author: ckoell
Date: Tue Nov 15 11:56:52 2011
New Revision: 1202144

URL: http://svn.apache.org/viewvc?rev=1202144&view=rev
Log:
JCR-3148 Using transactions still leads to memory leak

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XASessionImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XASessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XASessionImpl.java?rev=1202144&r1=1202143&r2=1202144&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XASessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XASessionImpl.java
Tue Nov 15 11:56:52 2011
@@ -319,12 +319,14 @@ public class XASessionImpl extends Sessi
         if (tx == null) {
             throw new XAException(XAException.XAER_NOTA);
         }
-        if (onePhase) {
-            tx.prepare();
+        try {
+        	if (onePhase) {
+        		tx.prepare();
+        	}
+        	tx.commit();
+        } finally {
+        	txGlobal.remove(xid);
         }
-        tx.commit();
-
-        txGlobal.remove(xid);
     }
 
     /**
@@ -335,9 +337,11 @@ public class XASessionImpl extends Sessi
         if (tx == null) {
             throw new XAException(XAException.XAER_NOTA);
         }
-        tx.rollback();
-
-        txGlobal.remove(xid);
+        try {
+        	tx.rollback();
+        } finally {
+        	txGlobal.remove(xid);
+        }
     }
 
     /**



Mime
View raw message