geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r153696 - in geronimo/trunk/modules/transaction/src: java/org/apache/geronimo/transaction/context/TransactionContextManager.java test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java
Date Mon, 14 Feb 2005 02:36:16 GMT
Author: djencks
Date: Sun Feb 13 18:36:15 2005
New Revision: 153696

URL: http://svn.apache.org/viewcvs?view=rev&rev=153696
Log:
Clearer assertion error message, don't try to commit a read-only transaction after prepare

Modified:
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
    geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java?view=diff&r1=153695&r2=153696
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
Sun Feb 13 18:36:15 2005
@@ -33,12 +33,11 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.ExtendedTransactionManager;
 import org.apache.geronimo.transaction.ImportedTransactionActiveException;
 import org.apache.geronimo.transaction.XAWork;
-import org.apache.geronimo.transaction.manager.Recovery;
 import org.apache.geronimo.transaction.manager.XidImporter;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 /**
  * @version $Rev$ $Date$
@@ -137,7 +136,7 @@
 
         try {
             int status = containerTransactionContext.getTransaction().getStatus();
-            assert status == Status.STATUS_ACTIVE || status == Status.STATUS_PREPARED;
+            assert status == Status.STATUS_ACTIVE || status == Status.STATUS_PREPARED: "invalid
status: " + status;
         } catch (SystemException e) {
             throw new XAException();
         }

Modified: geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java?view=diff&r1=153695&r2=153696
==============================================================================
--- geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java
(original)
+++ geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java
Sun Feb 13 18:36:15 2005
@@ -18,6 +18,7 @@
 package org.apache.geronimo.transaction.context;
 
 import javax.transaction.xa.Xid;
+import javax.transaction.xa.XAResource;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.transaction.ImportedTransactionActiveException;
@@ -51,8 +52,9 @@
         transactionContextManager.end(xid);
         transactionContextManager.begin(xid, 1000);
         transactionContextManager.end(xid);
-        transactionContextManager.prepare(xid);
-        transactionContextManager.commit(xid, false);
+        int readOnly = transactionContextManager.prepare(xid);
+        assertEquals(XAResource.XA_RDONLY, readOnly);
+//        transactionContextManager.commit(xid, false);
     }
 
     public void testNoConcurrentWorkSameXid() throws Exception {



Mime
View raw message