2 Replies Latest reply on Jun 24, 2005 8:12 PM by Scott Stark

    Faulty warning: Closing a connection for you

    Rudi Vankeirsbilck Newbie

      Hi all,

      My application has been running succesfully for a couple of month in development now, performance and scalability tests are showing that we are setting up and committing a lot of transactions so I started to look at setting the transaction attributes of my session beans correctly.

      Once I started doing that I am getting a lot of:

      11:42:36,758 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@a02dd1
      java.lang.Exception: STACKTRACE
       at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:282)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:506)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
       at com.bluespace.core.implementation.common.BusinessContext.getConnection(BusinessContext.java:40)
       at com.bluespace.core.persistence.tools.sql.DatabaseService.run(DatabaseService.java:87)
       at com.bluespace.core.persistence.system.helper.sql.GetActiveSessionId.execute(GetActiveSessionId.java:62)
       at com.bluespace.core.persistence.system.helper.sql.GetActiveSessionId.execute(GetActiveSessionId.java:46)
       at com.bluespace.core.persistence.system.ConnectionSessionIdPersistenceManagerBean.getActiveSessionId(ConnectionSessionIdPersistenceManagerBean.java:54)
      


      I am absolutely sure that I am always closing all jdbc resources. That's what the DatabaseService and the BusinessContext are for (doing try {} finally {jdbcResource.close()}).

      As explained, the above exception started to show up once I changed the transaction attribute of the ConnectionSessionIdPersistenceManager from "Required" to "Supports" as the method is only reading stuff from the database and not doing any inserts, updates or deletes.

      How can I avoid the exception?

      For your information, I am still running on:
      11:08:58,122 INFO [Server] Starting JBoss (MX MicroKernel)...
      11:08:58,125 INFO [Server] Release ID: JBoss [WonderLand] 3.2.2 (build: CVSTag=JBoss_3_2_2 date=200310182216)