[jboss-cvs] JBossAS SVN: r110057 - branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 21 03:40:25 EST 2010


Author: jesper.pedersen
Date: 2010-12-21 03:40:25 -0500 (Tue, 21 Dec 2010)
New Revision: 110057

Modified:
   branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java
Log:
[JBPAPP-5596] Revert previous fix due to regressions

Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java	2010-12-21 02:14:56 UTC (rev 110056)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java	2010-12-21 08:40:25 UTC (rev 110057)
@@ -49,9 +49,7 @@
 {
    private static final Logger log = Logger.getLogger(WrappedConnection.class);
 
-   private volatile BaseWrapperManagedConnection mc;
-   private BaseWrapperManagedConnection lockedMC;
-   private int lockCount;
+   private BaseWrapperManagedConnection mc;
 
    private WrapperDataSource dataSource;
    
@@ -81,11 +79,6 @@
       if (mc != null)
       {
          mc.tryLock();
-         if (lockedMC == null)
-         {
-            lockedMC = mc ;
-         }
-         lockCount++ ;
       }
       else
          throw new SQLException("Connection is not associated with a managed connection." + this);
@@ -93,12 +86,12 @@
 
    protected void unlock()
    {
-      BaseWrapperManagedConnection mc = lockedMC;
-      if (--lockCount == 0)
-      {
-         lockedMC = null;
-      }
-      mc.unlock();
+      BaseWrapperManagedConnection mc = this.mc;
+      if (mc != null)
+         mc.unlock();
+
+      // We recreate the lock when returned to the pool
+      // so missing the unlock after disassociation is not important
    }
 
    public WrapperDataSource getDataSource()
@@ -878,6 +871,8 @@
 
       if (mc != null)
          result = mc.connectionError(t);
+      else
+         result = t;
 
       if (result instanceof SQLException)
       {



More information about the jboss-cvs-commits mailing list