geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r154559 - in geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context: InheritableTransactionContext.java TransactionContext.java
Date Sun, 20 Feb 2005 19:37:38 GMT
Author: djencks
Date: Sun Feb 20 11:37:37 2005
New Revision: 154559

URL: http://svn.apache.org/viewcvs?view=rev&rev=154559
Log:
Clarify and repair meaning of isActive.  This fixes a connection pool leak when a connection
handle is closed after the transaction it is enrolled in is marked rollback only

Modified:
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/InheritableTransactionContext.java
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContext.java

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/InheritableTransactionContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/InheritableTransactionContext.java?view=diff&r1=154558&r2=154559
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/InheritableTransactionContext.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/InheritableTransactionContext.java
Sun Feb 20 11:37:37 2005
@@ -57,7 +57,8 @@
 
     public boolean isActive() {
         try {
-            return txnManager.getStatus() == Status.STATUS_ACTIVE;
+            int status = txnManager.getStatus();
+            return status == Status.STATUS_ACTIVE || status == Status.STATUS_MARKED_ROLLBACK;
         } catch (SystemException e) {
             return false;
         }

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContext.java?view=diff&r1=154558&r2=154559
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContext.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContext.java
Sun Feb 20 11:37:37 2005
@@ -167,6 +167,11 @@
         return managedConnections.get(key);
     }
 
+    /**
+     * determines if the transaction is in a pre-prepared state
+     * of STATUS_ACTIVE or STATUS_MARKED_ROLLBACK.
+     * @return true if more work can be done in the transaction (although it might be forced
to roll back)
+     */
     public abstract boolean isActive();
 
     public abstract Transaction getTransaction();



Mime
View raw message