[jboss-cvs] JBossAS SVN: r81295 - trunk/connector/src/main/org/jboss/resource/adapter/jdbc/remote.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 19 10:49:59 EST 2008


Author: jesper.pedersen
Date: 2008-11-19 10:49:59 -0500 (Wed, 19 Nov 2008)
New Revision: 81295

Modified:
   trunk/connector/src/main/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java
Log:
[JBAS-6149] Add special case for Connection.isClosed() -- Patch by Adrian Brock

Modified: trunk/connector/src/main/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java	2008-11-19 15:47:59 UTC (rev 81294)
+++ trunk/connector/src/main/org/jboss/resource/adapter/jdbc/remote/WrapperDataSourceService.java	2008-11-19 15:49:59 UTC (rev 81295)
@@ -206,6 +206,9 @@
             Connection conn = (Connection) connectionMap.get(id);
             if( conn == null )
             {
+               if(method.getName().equals("isClosed"))
+                  return true;
+
                throw new IllegalAccessException("Failed to find connection: "+id);
             }
             value = doConnectionMethod(conn, method, args);
@@ -361,7 +364,13 @@
          log.trace("doConnectionMethod, conn="+conn+", method="+method);
       }
 
-      // Connection.close() cant remove connection from the connectionMap due to Connection.isClosed()
+      // Remove the connection and handle Connection.isClosed() in invoke()
+      if( method.getName().equals("close") )
+      {
+         Integer id = new Integer(conn.hashCode());
+         connectionMap.remove(id);
+         log.debug("Closed Connection="+id);
+      }
 
       Object value = method.invoke(conn, args);
       if( value instanceof Statement )




More information about the jboss-cvs-commits mailing list