Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC Thin: "No more data to read from socket"
You can't expect a connection to persist through a db bounce.
This error indicates that the socket has been closed on the
server side.
There's no way to resuscitate the dead connection, but nothing should stop you from catching this exception, closing the old connection and opening a new one.
Since you can never expect network resources to be indefinitely stable, you always have to be prepared to catch exceptions of some sort anway. I use a wrapper class around the Connection object with a boolean flag indicating the connection's validity. Everywhere that I call an operation that results in a SQLException, I toggle this flag and return the dead connect to my connection pool, which does the necessary cleanup. It works quite well.
Brad Hill Received on Wed Sep 08 1999 - 12:26:00 CDT
![]() |
![]() |