svn commit: r179796 - /jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r179796 - /jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java

ozeigermann
Author: ozeigermann
Date: Fri Jun  3 07:24:10 2005
New Revision: 179796

URL: http://svn.apache.org/viewcvs?rev=179796&view=rev
Log:
Fix for bugzilla issue 35201. Non synchronized maps might cause problems in multi-threaded scenarios

Modified:
    jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java

Modified: jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java?rev=179796&r1=179795&r2=179796&view=diff
==============================================================================
--- jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java (original)
+++ jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java Fri Jun  3 07:24:10 2005
@@ -25,6 +25,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Collections;
 
 import javax.transaction.Status;
 import javax.transaction.xa.XAException;
@@ -41,8 +42,8 @@
     // there might be at least one active transaction branch per thread
     private ThreadLocal activeTransactionBranch = new ThreadLocal();
 
-    private Map suspendedContexts = new HashMap();
-    private Map activeContexts = new HashMap();
+    private Map suspendedContexts = Collections.synchronizedMap(new HashMap());
+    private Map activeContexts = Collections.synchronizedMap(new HashMap());
 
     public abstract boolean isSameRM(XAResource xares) throws XAException;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]