[jboss-svn-commits] JBL Code SVN: r30250 - in labs/jbosstm/trunk/ArjunaCore: arjuna/classes/com/arjuna/ats/arjuna/common and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 19 08:35:45 EST 2009


Author: mark.little at jboss.com
Date: 2009-11-19 08:35:45 -0500 (Thu, 19 Nov 2009)
New Revision: 30250

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/StateManager.java
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/PersistenceRecord.java
   labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/recovery/TORecoveryModule.java
Log:
https://jira.jboss.org/jira/browse/JBTM-615

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/StateManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/StateManager.java	2009-11-19 10:20:58 UTC (rev 30249)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/StateManager.java	2009-11-19 13:35:45 UTC (rev 30250)
@@ -1302,10 +1302,6 @@
         if ((myType == ObjectType.ANDPERSISTENT)
                 || (myType == ObjectType.NEITHER))
         {
-            /*
-             * If null, default object store type is obtained by the interface.
-             */
-
             int sharedStatus = ((objectModel == ObjectModel.SINGLE) ? ObjectStore.OS_UNSHARED
                     : ObjectStore.OS_SHARED);
 

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java	2009-11-19 10:20:58 UTC (rev 30249)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java	2009-11-19 13:35:45 UTC (rev 30250)
@@ -270,11 +270,14 @@
             }
             catch (StringIndexOutOfBoundsException e)
             {
-                if (tsLogger.arjLoggerI18N.isWarnEnabled())
+                if (!errsOk)
                 {
-                    tsLogger.arjLoggerI18N.warn(
-                            "com.arjuna.ats.arjuna.common.Uid_3", new Object[]
-                            { uidString }, e);
+                    if (tsLogger.arjLoggerI18N.isWarnEnabled())
+                    {
+                        tsLogger.arjLoggerI18N.warn(
+                                "com.arjuna.ats.arjuna.common.Uid_3", new Object[]
+                                { uidString }, e);
+                    }
                 }
 
                 _valid = false;

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/PersistenceRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/PersistenceRecord.java	2009-11-19 10:20:58 UTC (rev 30249)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/PersistenceRecord.java	2009-11-19 13:35:45 UTC (rev 30250)
@@ -331,12 +331,23 @@
 
 		if ((sm != null) && (store != null))
 		{
+		    /*
+		     * Get ready to create our state to be saved. At this stage we're not
+		     * sure if the state will go into its own log or be written into the
+		     * transaction log for improved performance.
+		     */
+		    
 			topLevelState = new OutputObjectState(sm.get_uid(), sm.type());
 
 			if (writeOptimisation
-					|| (!store.fullCommitNeeded()
+					&& (!store.fullCommitNeeded()
 							&& (sm.save_state(topLevelState, ObjectType.ANDPERSISTENT)) && (topLevelState.size() <= PersistenceRecord.MAX_OBJECT_SIZE)))
 			{
+			    /*
+			     * We assume that crash recovery will always run before
+			     * the object can be reactivated!
+			     */
+
 				if (PersistenceRecord.classicPrepare)
 				{
 					OutputObjectState dummy = new OutputObjectState(
@@ -362,6 +373,10 @@
 				}
 				else
 				{
+				    /*
+				     * Don't write anything as our state will go into the log.
+				     */
+				    
 					result = TwoPhaseOutcome.PREPARE_OK;
 				}
 			}
@@ -427,6 +442,8 @@
 		boolean res = false;
 		int objStoreType = 0;
 
+		topLevelState = null;
+		
 		try
 		{
 			objStoreType = os.unpackInt();
@@ -517,7 +534,8 @@
 
 					/*
 					 * If we haven't written a shadow state, then pack the state
-					 * into the transaction log.
+					 * into the transaction log. There MUST be a state at this
+					 * point.
 					 */
 
 					if (!shadowMade)

Modified: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/recovery/TORecoveryModule.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/recovery/TORecoveryModule.java	2009-11-19 10:20:58 UTC (rev 30249)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/recovery/TORecoveryModule.java	2009-11-19 13:35:45 UTC (rev 30250)
@@ -32,11 +32,11 @@
 package com.arjuna.ats.internal.txoj.recovery;
 
 import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.ats.arjuna.coordinator.TxControl;
 import com.arjuna.ats.arjuna.state.*;
 
 import com.arjuna.ats.txoj.logging.txojLogger;
 
+import com.arjuna.ats.arjuna.logging.tsLogger;
 import com.arjuna.ats.arjuna.objectstore.*;
 import com.arjuna.ats.arjuna.recovery.RecoveryModule;
 
@@ -44,6 +44,7 @@
 
 import java.util.*;
 
+import com.arjuna.ats.arjuna.exceptions.FatalError;
 import com.arjuna.ats.arjuna.exceptions.ObjectStoreException;
 import com.arjuna.ats.internal.arjuna.common.UidHelper;
 
@@ -79,6 +80,9 @@
  * @message com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_8
  *          [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_8] -
  *          TORecoveryModule.periodicWork(): Object ({0}, {1}) no longer exists.
+ * @message com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_osproblem
+ *          [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_osproblem] -
+ *          TORecoveryModule - could not create ObjectStore instance!
  */
 
 public class TORecoveryModule implements RecoveryModule
@@ -89,6 +93,7 @@
      * modifications to locations must occur in the properties file.
      */
 
+    @SuppressWarnings("unchecked")
     public TORecoveryModule()
     {
         if (txojLogger.aitLoggerI18N.isDebugEnabled())
@@ -104,8 +109,18 @@
         /*
          * Where are TO's stored. Default.
          */
+      
+        try
+        {
+            Class osc = Class.forName(arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreType());
 
-        _objectStore = TxControl.getStore();
+            _objectStore = (ObjectStore) osc.newInstance();
+        }
+        catch (final Throwable ex)
+        {
+            throw new FatalError(tsLogger.log_mesg
+                    .getString("com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_osproblem"), ex);
+        }
     }
 
     public void periodicWorkFirstPass ()
@@ -166,8 +181,9 @@
                                             String newTypeString = new String(
                                                     theName);
                                             Uid newUid = new Uid(theUid);
-                                            _uncommittedTOTable.put(newUid,
-                                                    newTypeString);
+                                            
+                                            _uncommittedTOTable.put(newUid,newTypeString);
+                                            
                                             if (txojLogger.aitLoggerI18N
                                                     .isDebugEnabled())
                                             {



More information about the jboss-svn-commits mailing list