-
1. java.sql.SQLException: Connection handle has been closed an
phani.chavala Aug 17, 2007 5:20 AM (in response to vivek_koul)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 Aug 17, 2007 11:42 AM (in response to vivek_koul)After connection.close, to get a new connection use DataSource.open() again.
-
3. Re: Connection handle has been closed and is unusable
oenyinna Oct 2, 2009 11:16 AM (in response to vivek_koul)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 Feb 12, 2010 7:39 AM (in response to oenyinna)Please send your solution here. I have the same problem.
Thanks