-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

Hi there

In my current JServ/Apache configuration I have a number of servlets loaded
at startup which (in their initialization)
instantiate a database connection to a remote database. My problem is that
the database uses a TCP connection to
a machine outside our lan and thus goes through a router. The router has a
set timeout on these connections. So here's
my question (And my most sincere apologies if this issue has already been
dealt with) :

    How can I check if the database connection has been dropped and
re-initialize it if so ? Idealy I wouldn't like
    to be forced to re-init it during a doGet/doPost request as this will
cause browsers to wait longer for their
    requests to be serviced. I've tried the following in the doGet method of
one of my servlets to no avail :

    if(DatabaseConnection.isClosed())
      DatabaseConnection = DriverManager.getConnection
("jdbc:oracle:oci8:@"+DatabaseHost,DatabaseUser,DatabasePassword);

   My configuration is as follows:

    Apache 1.3.9/ JServ 1.0
    RedHat Linux 6.0
    Oracle8 using OCI (Native) JDBC Drivers
    Blackdown Java 1.1.7v3

Any help appreciated.
Reuben




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to