|
-
May 2nd, 2005, 06:03 AM
#1
destroy servlet database connection
hello guys
i am facing a problem regarding one of my servlet
i use init() method to initialize the connection to the database and after that i use destroy method to disconnect from the database.
like this
destroy() {
try {
connection.close();
}
catch (Exception e){
out.println(e);
}
but the problem is after a couple of hours and i think when the destroy method executed any request to the database failed.
this is the exception
java.sql.SQLException: No operations allowed after connection closed.
now i dont really know the solution for this matter but if there is a way to solve it please dont hasitate to response
thanks
-
May 2nd, 2005, 11:25 AM
#2
Re: destroy servlet database connection
can any one help
the second thing is the method destroy() shutdown all my connection to the server or the database so in case i request data from the database in the future should the database response.
thanks alot
-
May 2nd, 2005, 11:41 AM
#3
Re: destroy servlet database connection
Most likely the database is closing the connection due to inactivity well before your container unloads your servlet and calls destroy. This would be a timeout setting on the database config files. You should perhaps make database connections on a per request basis if there really is hours between requests or look into connection pooling support for your servlet container.
"The Chicken and Rice MRE is not a personal lubricant."
-
May 2nd, 2005, 12:37 PM
#4
Re: destroy servlet database connection
thank you joe
now what is connection pooling ? and how can i get one?
until now i cant connect to the database
and i get this message
unavailable invoker
strange
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|