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)
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
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