geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r511313 - in /geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound: ./ connectionmanagerconfig/
Date Sat, 24 Feb 2007 17:44:37 GMT
Author: kevan
Date: Sat Feb 24 09:44:36 2007
New Revision: 511313

URL: http://svn.apache.org/viewvc?view=rev&rev=511313
Log:
GERONIMO-2838 Initial fix for Transaction Recovery. Still some problems, but this enables
the basic TR flows. This fix will identify a bug in AMQ. Until AMQ-1088 is fixed, expect to
see an exception on startup

Modified:
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
Sat Feb 24 09:44:36 2007
@@ -88,13 +88,17 @@
 
     public ConnectionManagerContainer.ReturnableXAResource getRecoveryXAResource(ManagedConnectionFactory
managedConnectionFactory) throws ResourceException {
         ManagedConnectionInfo mci = new ManagedConnectionInfo(managedConnectionFactory, null);
-        NamedXAResource namedXAResource = (NamedXAResource) mci.getXAResource();
-        if (namedXAResource == null) {
-            //obviously, we can't do recovery.
+
+        // if no recovery stack, then this isn't a recoverable resource.
+        if (getRecoveryStack() == null) {
             return null;
         }
+        
         ConnectionInfo recoveryConnectionInfo = new ConnectionInfo(mci);
         getRecoveryStack().getConnection(recoveryConnectionInfo);
+
+        NamedXAResource namedXAResource = (NamedXAResource) mci.getXAResource();
+        getRecoveryStack().returnConnection(recoveryConnectionInfo, ConnectionReturnAction.DESTROY);
         return new ConnectionManagerContainer.ReturnableXAResource(namedXAResource, getRecoveryStack(),
recoveryConnectionInfo);
     }
 

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
Sat Feb 24 09:44:36 2007
@@ -98,9 +98,13 @@
                 stack = new SubjectInterceptor(stack);
             }
 
-            ConnectionInterceptor recoveryStack = stack;
-            this.recoveryStack = new TCCLInterceptor(recoveryStack, classLoader);
-
+            // Only create a recovery stack, if the resource is recoverable.
+            if (transactionSupport.isRecoverable()) {
+                this.recoveryStack = new TCCLInterceptor(stack, classLoader);
+            }
+            else {
+                this.recoveryStack = null;
+            }
 
             stack = new ConnectionHandleInterceptor(stack);
             stack = new TCCLInterceptor(stack, classLoader);

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java
Sat Feb 24 09:44:36 2007
@@ -44,4 +44,8 @@
         stack = new TransactionEnlistingInterceptor(stack, transactionManager);
         return new TransactionCachingInterceptor(stack, transactionManager);
     }
+    
+    public boolean isRecoverable() {
+        return false;
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java
Sat Feb 24 09:44:36 2007
@@ -40,4 +40,8 @@
     public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack,
TransactionManager transactionManager) {
         return stack;
     }
+    
+    public boolean isRecoverable() {
+        return false;
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java
Sat Feb 24 09:44:36 2007
@@ -45,4 +45,8 @@
         stack = new TransactionEnlistingInterceptor(stack, transactionManager);
         return new TransactionCachingInterceptor(stack, transactionManager);
     }
+    
+    public boolean isRecoverable() {
+        return false;
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java
Sat Feb 24 09:44:36 2007
@@ -32,5 +32,5 @@
 public abstract class TransactionSupport implements Serializable {
     public abstract ConnectionInterceptor addXAResourceInsertionInterceptor(ConnectionInterceptor
stack, String name);
     public abstract ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor
stack, TransactionManager transactionManager);
-
+    public abstract boolean isRecoverable();
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java?view=diff&rev=511313&r1=511312&r2=511313
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java
Sat Feb 24 09:44:36 2007
@@ -32,6 +32,7 @@
  *
  * */
 public class XATransactions extends TransactionSupport {
+    
     private boolean useTransactionCaching;
     private boolean useThreadCaching;
 
@@ -71,5 +72,9 @@
             stack = new TransactionCachingInterceptor(stack, transactionManager);
         }
         return stack;
+    }
+    
+    public boolean isRecoverable() {
+        return true;
     }
 }



Mime
View raw message