Hi, So you want the servlet to always keep the connection open and available? If your web-server is long-lived, that may not be the best idea.
How about having some singleton that keeps the connection, and a monitor thread that periodically validates the connection? If the connection is corrupt, the monitor thread would notify the singleton, which would then drop the connection and create a new one. Or just start using a 3rd party connection pool implementation, e.g. commons-dbcp ;) Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: G�nter Kukies [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, July 10, 2002 10:56 AM >To: Tomcat Users List >Subject: reload servlet after any Exception > >Hi, > >my servlet opens a jdbc connection in init() (connection pooling) and saves >the connection in a variable. >If the database becomes out of service for any reason, the connection gets >corrupted and the servlet throws a SQLException. >Is it possible to reload (init()) the servlet after an Exception (at the >next servlet request), >to try to connect when the database is up again? > >G�nter Kukies > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
