3 Replies Latest reply on Mar 27, 2008 1:43 AM by sandeepdjboss

    CachedConnection Manager exception

    sandeepdjboss

      Hi,

      I am using jboss-5.0.0.Beta2; I have recently migrated my application from weblogic to JBoss; I have been facing a strange issue.
      This code works in production for weblogic; so I can believe it can be a problem with code.

      I am using JBOSS connection pooling for connecting to database. It looks JBoss is closing some connections on its own throwing below exception:-


      [200710281:043148][WorkerThread#0[10.253.58.131:2713]]com.ssp.tbo.fw.record.ThinCursorServer.removeOpenCursor:201> Removed cursor key 106973.2.2

      2007-10-08 04:31:48,216 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@15facb0

      java.lang.Throwable: STACKTRACE

      at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)

      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:415)

      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:838)

      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)







      And the next thing is does is to fire the query on this connection; and I get following error


      EXCEPTION WITH STACK TRACE FOLLOWS

      java.sql.SQLException: Connection handle has been closed and is unusable

      at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:537)

      at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:524)

      at org.jboss.resource.adapter.jdbc.WrappedConnection.createStatement(WrappedConnection.java:142)






      This is very strange behavior.. Why JBOSS closes the connections so early. We do close it pro grammatically when we are done with the connection. It all happens in very short period of time so JBOSS ideally should not close the connections.

      This is irregular behavior as next time you fire a query it may work; and after couple of more attempts you may get to the same exception.


      Any light on above exception would be greatly appreciated....

      Thanks so much.
      Sandeep

        • 1. Re: CachedConnection Manager exception
          chrismongillo

          Hi,
          your problem hit me and my team few days ago and I resolved with this:

          http://wiki.jboss.org/wiki/Wiki.jsp?page=WhatDoesTheMessageDoYourOwnHousekeepingMean

          I think you can find easily the solution turning off connection close checking.
          If you migrating from WebLogic (that's my work task too during this week) you have to consider in disabling the CachedConnectionValve in server.xml under jboss-web.deployer folder.
          This works fine for me under JBoss 4.2.2 because I have my own cache in my sources and I check pro grammatically for unclosed connections.
          I hope you'll find the light ;)

          bye Chris

          • 2. Re: CachedConnection Manager exception
            chrismongillo

            I think this post could be move under the right area, maybe JCA or Configuration under Jboss User.

            ;)

            • 3. Re: CachedConnection Manager exception
              sandeepdjboss

              Thanks Chris,
              I had earlier tried to disable the option [Cached connection Manager ] After using this it started throwing weird errors; regarding inconsistent states...
              [Dont remeber exact error as it is 5 months since then....
              I am using jboss-5.0.0.Beta2 -- though it is beta version ]

              After which I have written my own connection code [custom connections ] which picks up the custom made connection if the Pooled one fails.

              This is working for me now :)

              Really appreciate you help!!
              I will also put the topics under right titles going forward :)

              Thanks buddy.

              Cheers,
              Sandeep