Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with Time Outs

0 views
Skip to first unread message

Adam Levine

unread,
Jan 21, 1998, 3:00:00 AM1/21/98
to

I am connecting to an Oracle server via an applet using Oracles JDB thin
client. No problems there. However, if I leave the "client"/applet
sitting for x amounf of time, and then try to communicate with the
server, I get a
java.sql.SQLException: No more data to read from socket

If I test my connection ( (Connection)conn.isClosed() ), it returns a
false (iow, connection still present). I've tried re-establishing the
connection, but to no avail. Only if I restart/reload the applet will it
reconnect.

Any suggestions on _what_ exactly is happening and how I can prevent
it? Thanks.

** snippet from messages window follows **

java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:382)
at oracle.jdbc.ttc7.TTCInBuffer.getByte(TTCInBuffer.java:94)
at oracle.jdbc.ttc7.TTIMsg.unmarshalSB1(TTIMsg.java:929)
at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:109)
at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:350)
at
oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:129)
at
oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:39)
at
oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:137)
at Cancel.bGetInfo_Clicked(Cancel.java:197)
at Cancel.handleEvent(Cancel.java:485)
at java.awt.Component.postEvent(Component.java:1576)
at java.awt.Component.postEvent(Component.java:1586)
at java.awt.Component.dispatchEventImpl(Component.java:1468)
at java.awt.Component.dispatchEvent(Component.java:1393)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

Mark Johnston

unread,
Jan 28, 1998, 3:00:00 AM1/28/98
to ale...@pagemart.com

Hi Adam:

I had the same problem. My workaround was crude.

1: Open the connection
2: Get in and processe your data (ie access and update, 10 mins seems to
be the time frame for me)
3: Close the connection

repeat above until done! This requires adopting a different strategy in
developing your code. (ie batch processing as opposed to start at the
beginning and work to the end)

This problem has something to do with the Garbage Collection within
Java. I haven't tried explicitly disabling the Garbage Collection when I
run my code. You might want to investigate this.

Mark

..............................................................................................................

Mark Johnston
Web Developer
tantalus communications inc.
201 - 1110 hamilton street
vancouver, bc canada V6B 2S2
m...@tantalus.com

Tel: 604.609.0704
Fax: 604.609.0705

“Custom Databases, On-line Mapping and E-Commerce”
http://www.tantalus.com


Adam Levine wrote:

> .jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:39)
>
> at
> oracl

Markus Schlegel

unread,
Jan 30, 1998, 3:00:00 AM1/30/98
to

Hi Adam
I have exactly the same problem as you!
I've written a Servlet, who connects to Oracle using the OracleThin. When I
called the Servlet the first time, everything was going well. I could call
it as many times I would (from several Clients at the same time). But when I
made a break for about five or ten minutes and then retryed it, it gave this
exception...
I don't know exactly what what the Problem is. Probably it's a SQL*NET
problem, or it is a Socket-Connection problem, or it is a BUG in OracleThin,
or a BUG in the VM (I'm using JDK1.1.5).
It's devinitly not a DB-TimeOut, because our DBases have no TimeOuts
specified.

So I made a WorkAround:
When the Exception occurs (no more data to read....), I'm setting the
Connection to null (connection=null;) and then I'm reconnecting. This will
work fine and you don't have to reconnect at every time.

The conn.isClosed() Method is *not* working well. But who is providing it?
Is it Oracle, who implements the Connection Interface? Then we should tell
this to Oracle...

Mark

0 new messages