> Hi All,
> What is the best method the close the dead database connection(oracle)
[quoted text clipped - 4 lines]
> Is there anyway to set connection timeout period for the connection
> that will automatically close the connection in my souce code?
DriverManager.setLoginTimeout
From the API:
public static void setLoginTimeout(int seconds)
Sets the maximum time in seconds that a driver will wait while
attempting to connect to a database.
David Harper
Cambridge, England
> Hi All,
> What is the best method the close the dead database connection(oracle)
[quoted text clipped - 21 lines]
> Thanks in advance.
> -Dish
Hi. No, there's no way to define ahead of time that a connection will
self-close at any particular time. Are you absolutely sure that no
other thread is using this connection?
I suspect that you have a firewall between the DBMS and driver.
If that is true, the firewall may kill sockets that haven't been
used for some time, and after that anything the driver sends on
that socket will be ignored, but from the driver's and OS's point
of view, the socket isn't dead so your close (or any other call)
may hang for a long time or indefinitely. Your best solution is
to either keep your connections busy enough that the firewall
never kills them, (even artificially with an occasional 'select 1
from dual'), or you must be sure to close your idle connections
before they are closed by the firewall.
Joe Weinstein at BEA Systems
Dishan - 22 Feb 2007 03:35 GMT
Yes. There is a firewall between my tomcat and the database server.
Thanks for your comment!
On Feb 21, 8:26 pm, "joeNOS...@BEA.com" <joe.weinst...@gmail.com>
wrote:
> > Hi All,
> > What is the best method the close the dead database connection(oracle)
[quoted text clipped - 39 lines]
>
> - Show quoted text -