4 Replies Latest reply on Feb 12, 2010 7:39 AM by peyman

    Connection handle has been closed and is unusable

    vivek_koul

      hii

      im using jboss-4.0.1
      im runnig some sql query in some method i have closed connections in the
      finally block but still i get this error on console

      12:42:07,695 INFO [STDOUT] Exception in transactionjava.lang.NullPointerException
      12:42:07,695 INFO [STDOUT] java.sql.SQLException: Connection handle has been closed and is unusable

      please help in this regard
      thank you in advance
      vivek

        • 1. java.sql.SQLException: Connection handle has been closed an
          phani.chavala

          Hi Guyz,

          I am using jboss-4.0.3. i am experimenting with DAO patterns i wrote a program which handels all DB related operations like add, update, delete etc., For any DB operations i am unble to get the success. i am always ending with the exception stack trace.

          UserDao is my Class name
          createUser is my method name

          14:24:13,764 ERROR [UserDao] >>>>>>>>>> SQLException In UserDao.createUser() java.sql.SQLException: Connection handle has been closed and is unusable at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:526)
          at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:513)
          at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:169)

          if anybody got the solution. plz let me know it would realy boost my task.

          i am getting a separate connection for each and every opperation and closing that connection after compleetion.

          is this the right way of getting a new connection for each new opperation. or can i maintain a single connection for all the operations plz let me know.

          Thanks
          Phani.Chavala

          • 2. Re: Connection handle has been closed and is unusable
            genman

            After connection.close, to get a new connection use DataSource.open() again.

            • 3. Re: Connection handle has been closed and is unusable
              oenyinna

              I'm trying to keep a jdbc connection open between method calls but it seems to close automatically. How can I keep it open? I'm using Jboss 4.0.5. Thanks

              • 4. Re: Connection handle has been closed and is unusable
                peyman

                Please send your solution here. I have the same problem.

                 

                Thanks