[jboss-svn-commits] JBL Code SVN: r37728 - in labs/jbosstm/branches/JBOSSTS_4_15_0_Final: ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Nov 21 09:39:04 EST 2011


Author: jhalliday
Date: 2011-11-21 09:39:03 -0500 (Mon, 21 Nov 2011)
New Revision: 37728

Modified:
   labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/arjunaI18NLogger.java
   labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java
   labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java
Log:
Improve 'multiple last resources' log message. JBTM-960


Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/arjunaI18NLogger.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/arjunaI18NLogger.java	2011-11-21 12:26:56 UTC (rev 37727)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/arjunaI18NLogger.java	2011-11-21 14:39:03 UTC (rev 37728)
@@ -586,9 +586,9 @@
 	@LogMessage(level = WARN)
 	public void warn_lastResource_disableWarning();
 
-	@Message(id = 12140, value = "Adding multiple last resources is disallowed. Current resource is {0}", format = MESSAGE_FORMAT)
+	@Message(id = 12140, value = "Adding multiple last resources is disallowed. Trying to add {0}, but already have {1}", format = MESSAGE_FORMAT)
 	@LogMessage(level = WARN)
-	public void warn_lastResource_disallow(String arg0);
+	public void warn_lastResource_disallow(String arg0, String arg1);
 
 	@Message(id = 12141, value = "Multiple last resources have been added to the current transaction. This is transactionally unsafe and should not be relied upon. Current resource is {0}", format = MESSAGE_FORMAT)
 	@LogMessage(level = WARN)
@@ -1448,7 +1448,7 @@
 
     @Message(id = 12368, value = "Node identifiers must be an integer and must be 1 or greater: {0}", format = MESSAGE_FORMAT)
 	public String get_node_identifier_invalid(int nodeIdentifier);
-    
+
     @Message(id = 12369, value = "The node identifier was already set", format = MESSAGE_FORMAT)
 	public String get_node_identifier_reset_attempt();
 

Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java	2011-11-21 12:26:56 UTC (rev 37727)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java	2011-11-21 14:39:03 UTC (rev 37728)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
  * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
+ * full listing of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -24,7 +24,7 @@
  * Arjuna Technologies Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
- * UK.  
+ * UK.
  *
  * $Id: LastResourceRecord.java 2342 2006-03-30 13:06:17Z  $
  */
@@ -51,7 +51,7 @@
  * invokes the second phase on *all* participants, starting with the one that is
  * only one-phase aware. If it rolls back, it rolls all resources back, but the
  * order is not important.
- * 
+ *
  * @author Mark Little (mark at arjuna.com)
  * @version $Id: LastResourceRecord.java 2342 2006-03-30 13:06:17Z $
  * @since ATS 3.2.
@@ -145,7 +145,7 @@
 
         if (_lro == null)
             return TwoPhaseOutcome.PREPARE_NOTOK;
-        
+
         switch (_lro.commit())
         {
         case TwoPhaseOutcome.FINISH_OK:
@@ -157,6 +157,14 @@
         }
     }
 
+    @Override
+    public String toString()
+    {
+
+
+        return "LastResourceRecord("+_lro+")";
+    }
+
     public void print (PrintWriter strm)
     {
         strm.println("LastResource for:");
@@ -182,7 +190,7 @@
                 return true;
             }
             else {
-                tsLogger.i18NLogger.warn_lastResource_disallow(a.toString());
+                tsLogger.i18NLogger.warn_lastResource_disallow(this.toString(), a.toString());
 
                 return false;
             }

Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java	2011-11-21 12:26:56 UTC (rev 37727)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java	2011-11-21 14:39:03 UTC (rev 37728)
@@ -105,11 +105,11 @@
     public int commit()
     {
         boolean doForget = false;
-        
+
         try
         {
             // TODO we don't do an end here yet we do in 2PC. Check!!
-            
+
             xaResource.commit(xid, true) ;
             return TwoPhaseOutcome.FINISH_OK ;
         }
@@ -118,7 +118,7 @@
             if (jtaLogger.logger.isTraceEnabled()) {
                 jtaLogger.logger.trace("XAOnePhaseResource.commit(" + xid + ") " + xae.getMessage());
             }
-            
+
             switch (xae.errorCode)
             {
             case XAException.XA_HEURHAZ:
@@ -172,7 +172,7 @@
                 }
             }
         }
-        
+
         return TwoPhaseOutcome.ONE_PHASE_ERROR; // presume abort.
     }
 
@@ -197,7 +197,7 @@
                 jtaLogger.logger.trace("XAOnePhaseResource.rollback(" + xid + ") " + ex.getMessage());
             }
         }
-        
+
         return TwoPhaseOutcome.FINISH_ERROR ;
     }
 
@@ -296,6 +296,12 @@
         }
     }
 
+    @Override
+    public String toString()
+    {
+        return "XAOnePhaseResource("+xaResource+")";
+    }
+
     /**
      * Generate the IOException for the corresponding unpack exception.
      * @param ex The exception caught in unpack.



More information about the jboss-svn-commits mailing list