You could execute some simple SQL and catch any exceptions to test the
connection and re-establish it if necessary. There's also an isClosed()
method of Connection which the docs say will test to see if a connection
is closed.

Theres some stuff in javax.sql (jdbc extensions) that provide
ConnectionEventListener to notify you of connection object changes. I
don't know anything more about this, but it might be useful.

On Thu, 1 Feb 2001, Yin Tse wrote:

> Hi all,
> I'm having a problem with a jdbc connection object between tomcat and an
> oracle server. The 2 machines are separated by a firewall which was
> configured to allow access to the oracle server from the tomcat server only.
> The problem starts when the timeout period(which can be set to an arbitray
> time period) of idle time runs out. It sends a timeout signal and that
> breaks the jdbc connection. The application then freezes any attempts to log
> in/manage your account or do activities which need database connection. But
> tomcat still works fine, any servlets which do not need database connection
> works fine. 
> I added some code to check if my connection object is null and to create a
> new one if it is so. That didn't solve the problem which means that the
> connection object is not killed, but its content (like db driver, conn url ,
> login & password etc..)is somehow scrambled. My question is how can I manage
> those jdbc connection objects and how to figure out when something went
> wrong with the connection object ? Thanks all.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to