[jboss-svn-commits] JBL Code SVN: r32443 - labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Apr 6 08:25:30 EDT 2010


Author: jhalliday
Date: 2010-04-06 08:25:30 -0400 (Tue, 06 Apr 2010)
New Revision: 32443

Modified:
   labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java
Log:
Backport TxControl.getStore fix to CP branch. JBTM-613


Modified: labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java	2010-04-06 12:03:10 UTC (rev 32442)
+++ labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java	2010-04-06 12:25:30 UTC (rev 32443)
@@ -210,6 +210,10 @@
 
 	public static final ObjectStore getStore()
 	{
+        if(_objectStore != null) {
+            return _objectStore;
+        }
+
 		/*
 		 * Check for action store once per application. The second parameter is
 		 * the default value, which is returned if no other value is specified.
@@ -241,12 +245,17 @@
 
 		/*
 		 * Defaults to ObjectStore.OS_UNSHARED
+		 *
+		 * yes, it's unsynchronized. It does not matter much if we create more than once, we just want best
+		 * effort to avoid doing so on every call as it's a little bit expensive.
 		 */
 
 		if (sharedTransactionLog)
-			return new ObjectStore(actionStoreType, ObjectStore.OS_SHARED);
+			_objectStore = new ObjectStore(actionStoreType, ObjectStore.OS_SHARED);
 		else
-			return new ObjectStore(actionStoreType);
+			_objectStore = new ObjectStore(actionStoreType);
+
+        return _objectStore;
 	}
 
 	public static final boolean getAsyncPrepare()
@@ -331,6 +340,7 @@
 	private static TransactionStatusManager transactionStatusManager = null;
 
 	static ClassName actionStoreType = null;
+    private static ObjectStore _objectStore = null;
 
 	static byte[] xaNodeName = null;
 



More information about the jboss-svn-commits mailing list