1 Reply Latest reply on Feb 18, 2005 4:52 PM by Matt Lin

    [CachedConnectionManager] Closing a connection for you

    Matt Lin Newbie

      I found that a lot of people had the same problems before, but
      I can not find solutions to my problems. Please help.

      In my stateful session bean, I use JDBC to connect to Cloudscape database.
      I got the following error at run time(I tried on both Jboss 3.2.6 and 4.0.1):
      Connection handle has been closed and is unusable

      I noticed the messages at console before the above error:
      [CachedConnectionManager] Closing a connection for you

      In my code, I set Auto Commit to false after getting the connection, so that I can re-use the same connection for the multiple queries.
      However, Jboss CachedConnectionManager still closed it for me.
      Is there a way to tell CachedConnectionManager NOT to close the connection when AutoCommit is false?


        • 1. Re: [CachedConnectionManager] Closing a connection for you
          Matt Lin Newbie

          Finally, I found a message in the Forum, which describes the way to turn off the Connection Close Monitoring.
          It works for me now.
          But should CachedConnectionManager check the Connection auto commit setting before closing it?
          (That is if auto commit is false, don't close the connection. And users are on their own to make sure everything is closed correctly.)

          In the folowing file:

          transaction-service.xml for 3.2.x
          jbossjca-service.xml for 4.x

          <!-- Enable connection close debug monitoring -->

          Change setting to false.