Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Connection handling with jdbc.oracle.thin
Hello,
I've got serious problems managing connections from a servlet to
the oracle server. I'm using Apache 1.3.6 with Apache JServ and
JDK 1.2 running on Linux 2.0.36. The Oracle is a 8.0.5 NT. For
performance reasons I instantiate the Connection objects in the
servlet's init() method, so that I can save time in doGet() or
doPost() because the connection is already there and many threads
can share this connection. That works really fine, but when
leaving that connection idle for a while, say about one hour (I didn't
exactly measure the time), the servlet hangs when doing a request.
There is no exception thrown and no error log. After some debugging
it seems that <statement>.executeQuery() never returns and that this
is not a query or RDBMS problem but a timeout on the network connection
to the oracle server. I read lots of documentation but I did not
find anything about such a timeout. Neither <Connection>.setLoginTimeout()
nor <Statement>.setQueryTimeout() show any effect on this behaviour.
Did anyone ever experience this problem and does anyone have a solution for that? One could say 'create the connection in doGet() and close it there', but I don't want to do this if there's any possibility to avoid it.
Thanks in advance,
Joerg
Received on Mon Nov 22 1999 - 13:01:34 CST