[jboss-cvs] JBossAS SVN: r110710 - branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/connectionmanager.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 18 08:58:11 EST 2011


Author: jesper.pedersen
Date: 2011-02-18 08:58:11 -0500 (Fri, 18 Feb 2011)
New Revision: 110710

Modified:
   branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java
Log:
[JBPAPP-5292] Add more debug statements

Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java	2011-02-18 10:42:54 UTC (rev 110709)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java	2011-02-18 13:58:11 UTC (rev 110710)
@@ -568,8 +568,8 @@
                Object connection = null;
                try
                {
+                  connection = openConnection(mc, subject);
                   xaResource = mc.getXAResource();
-                  connection = openConnection(mc, subject);
                }
                catch (ResourceException reconnect)
                {
@@ -760,6 +760,9 @@
    {
       if (recoverMC == null)
       {
+         if (log.isDebugEnabled())
+            log.debug("Creating new managed connection for recovery");
+
          recoverMC = createManagedConnection(s, null);
       }
 
@@ -772,6 +775,9 @@
     */
    private void close(ManagedConnection mc)
    {
+      if (log.isDebugEnabled())
+         log.debug("Closing managed connection for recovery");
+
       if (mc != null)
       {
          try
@@ -797,6 +803,7 @@
       }
 
       mc = null;
+      recoverMC = null;
    }
 
    /**
@@ -808,6 +815,9 @@
     */
    private Object openConnection(ManagedConnection mc, Subject s) throws ResourceException
    {
+      if (log.isDebugEnabled())
+         log.debug("Creating connection for recovery check");
+
       return mc.getConnection(s, null);
    }
 
@@ -818,6 +828,9 @@
     */
    private boolean closeConnection(Object c)
    {
+      if (log.isDebugEnabled())
+         log.debug("Closing connection for recovery check");
+
       if (c != null)
       {
          if (c instanceof javax.resource.cci.Connection)
@@ -830,6 +843,10 @@
             catch (ResourceException ire)
             {
                log.warn("Error during recovery connection close", ire);
+
+               if (log.isDebugEnabled())
+                  log.debug("Forcing recreate of managed connection");
+
                return true;
             }
          }
@@ -854,12 +871,20 @@
                catch (Throwable it)
                {
                   log.warn("No close() method defined on connection interface. Destroying managed connection to clean-up", it);
+
+                  if (log.isDebugEnabled())
+                     log.debug("Forcing recreate of managed connection");
+
                   return true;
                }
             }
             catch (Throwable t)
             {
                log.warn("Error during recovery connection isValid", t);
+
+               if (log.isDebugEnabled())
+                  log.debug("Forcing recreate of managed connection");
+
                return true;
             }
          }



More information about the jboss-cvs-commits mailing list