How can I set the timeout limit? I would like the database connections to timeout if they are inactive for say 1/2 hour. I'm not even sure what the default is.
Well, there's a way to set a inactivity timeout smaller than the database one.
The idea would be a class that manages all database accesses. The class would open the connection and set a timestamp for the last access. Then, another class in another thread would wait for the specified timeout and would close the connection.
But, IMHO, this is not an application issue. In fact, if you use an application server, you can define a timeout for each kind of connection.
Interesting thought, Dian. In fact I am using an application server - Glassfish. Can I do something in the web.xml? If you could just point me in the right direction I'd appreciate it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.