java.sql.SQLException: Connection handle has been closed and is unusable
rai talari
Ranch Hand
Joined: Jan 31, 2006
Posts: 34
posted
0
hi iam using jboss 3.2.3 it is giving sqlexception as "java.sql.SQLException: Connection handle has been closed and is unusable" .what may be the problem pls notify me
nothing is impossible in the world even the word impossible sounds as I'M'Possible.
Tempted to move this to the JBoss forum (you might find more help there) but it is probably a JDBC issue.
Are you using connection pooling or direct JDBC? The error your describing is if the database connection has been closed. I'm not sure why you are trying to read a closed database connection instead of opening a new one, but we'd likely need to see some code or hear more information to help.
Originally posted by rai talari: hi iam using jboss 3.2.3 it is giving sqlexception as "java.sql.SQLException: Connection handle has been closed and is unusable" .what may be the problem pls notify me
rai,
there's a setting in the yourapp-ds.xml file that allows for a reconnection to the database. i think this error is encountered when a network connection from the app server to the db server breaks, or, when the db server is restarted and the app server isn't.
have a look:
taken from a jboss4.0.2serverinstalldir/docs/examples/jca/mysql-ds.xml
This can be due to the way you handle the transactions. If you try to handle transactions manually with setAutoCommit() and at the same time try to use session beans which in turn do some
database operations using the datasource or entity beans or any other way this can happen.
Solution is to use JTA transactions for your manual transaction part. Following code snippet explains how.
How to mixing JTA with Hibernate Template (session) ?.. is it possible?..
May you give me an example?..
i want to make a transaction like this.. (Quoted from your post before)
Do i have to use sessionFactory?
Thanks in advance sir..
Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]