Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Connection handling with jdbc.oracle.thin

Re: Connection handling with jdbc.oracle.thin

From: Stas Burdan <stas_at_mediaone.net>
Date: Tue, 23 Nov 1999 00:01:42 -0500
Message-ID: <383A1FB6.4DF21476@mediaone.net>


I experienced some unexplained network behavior as well when I worked with servlets both with java.net.Socket and java.sql.ResultSet. I guess it may be related with particular web server environment running particular VM.
Instead of trucking down the problem I would recommend the following

  1. Make sure your servlets are thread safe by properly synchronizing access to shared recourses
  2. Create a thread, which keeps track of connection usage
  3. When connection is idle for some time do a simple query and report the connection status.
  4. If the problem disappears - your suspicion about timeout is correct
  5. otherwise it isn't : make sure you are sure about 1)
    • Stas

> Just a thought, but check to be sure that there is no timeout set in the SqlNet
> configuration ( sqlnet.ora ) or either the client or the server...
>
> jorgland_at_sol.wohnheim.uni-ulm.de (Joerg Wendland) wrote:
>
> >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
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
> http://www.newsfeeds.com The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
Received on Mon Nov 22 1999 - 23:01:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US