Connection reset on MS JDBC driver

From: Andy Fish (ajfish_at_blueyonder.co.uk)
Date: 02/12/04


Date: 12 Feb 2004 06:36:43 -0800

Hi,

I have a problem with the MS JDBC driver whereby when I try to use a
connection after a long time idle it reports:

[Microsoft][SQLServer 2000 Driver for JDBC]Connection reset by peer

I've read plenty discussion on the subject and am convinced that
rather than trying to stop sockets from ever being closed, I need to
detect and re-open the connection.

I can't afford to rejig all the database code to detect this exception
and retry so I want to have my home made connection pool test the
connection before giving it out.

My question is, is there a way of pinging the server through JDBC to
see if the physical connection is still alive? If I have to do a SQL
command, what would be a good example of something that is guaranteed
to get through to the server but not take up too much processing or
network?

it seems to be accepted that any good connection pool should have this
feature - so if anyone knows how they do it I would like to know.

many thanks for any suggestions

Andy



Relevant Pages

  • Re: Connection reset on MS JDBC driver
    ... >> connection before giving it out. ... is there a way of pinging the server through JDBC to ... >> it seems to be accepted that any good connection pool should have this ...
    (comp.lang.java.databases)
  • Re: Connection refusals
    ... The fact that the server is calling out to other code could certainly lead ... Remember if the client (the ASP ... reuse the connection but has to create another. ... However in my experience filling the connection pool ...
    (microsoft.public.sqlserver.connect)
  • Re: Connection timeout
    ... The Connection Pool is a mechanism on the CLIENT, not the server. ... "Timeout expired. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection Pool in SQLserver 2005
    ... If the users are constantly in/out of the server, ... using connection pooling. ... through all layers all the way into the sqlserver. ... the sqlserver connection pool cannot be used...If ...
    (microsoft.public.sqlserver.connect)
  • Re: ASP.NET SQL Processes
    ... client application which made between the client and server. ... when we use the ADO.NET's connection ... Here is another msdn reference describing the .NET's connection pool ... | SQL server doesn't keep any processes attached to the application. ...
    (microsoft.public.dotnet.framework.aspnet)