RE: BUG: JDBC connection disconnected, can't reconnect



Hi,

we have exacty the same problem. Our environment:
Windows 2003 Standard SP2
SQL 2005 Standard
Sun JDK 1.6
SQL JDBC 1.2

Help much appreciated!

Marco

"Frank Sommers" wrote:

Hi,

Our environment is:
Windows Server 2003, Service Pack 2
SQL Server Express 2005
SQLServer JDBC driver 1.2
Sun JDK 1.6 (we tried this on JDK 1.5 as well)
There is no virus protection software on the host, and no firewall is enabled.

Our problem is that the JDBC connection running on the localhost
periodically gets disconnected, and then we can't reconnect to the database
at all, unless we physically power cycle the server.

This is a very strange situation, and to illustrate, I created the following
command-line program:

public class DBTest {

public static void main(String[] arg) throws Exception {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn =
DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;databaseName=datamart",
"username", "password");
System.out.println("Connected");
conn.close();
}
}

Essentially, this program verifies that a database connection can be made to
the SQL Server instance on the local host.

Executing this from the command line works the vast majority of the time.

However, once the Web application running on the same host encounters the
JDBC disconnection issue, executing this program from the command line
results in the following exception:

C:\Documents and Settings\frank>java -cp sqljdbc.jar;. DBTest
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException:
Software caused connect on abort: recv failed
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown
Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown
Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown
Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown
Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBTest.main(DBTest.java:7)

The relevant line seems to be:
Software caused connect on abort: recv failed

There is no way to obtain further access to the database, except by
power-cycling the machine. Shutting down and then re-starting the SQL Server
instance does not help, nor does restarting any individual process on the
server.

Something permanently disables connection to the database server, and only a
hard reset of the OS solves that problem.

Any suggestions would be most appreciated, as this is a serious,
mission-criticial problem for us right now.
.



Relevant Pages

  • RE: Cannot connect to my SQL 2005 server using JDBC - can any dia
    ... Do you have any references on which version of the Microsoft JDBC driver ... is talking about doesn't talk to UDP 1434 to retrieve the port automatically. ... I have seen some scenarios where not every JDBC drivers handles problems with the UDP broadcast from the SQL Browser service ... Cannot connect to my SQL 2005 server using JDBC - can any diagnostic tool tell me what the problem is? ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: JDBC or ODBC?
    ... we are choosing between a server that sits on top of Windows ... 2000 Server that can use ODBC directly with SQL 2000, or a new version of the ... How does JDBC ... performance implications we need to consider? ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: MS Access databases
    ... >> If anyone knows of a JDBC driver for MS Access ... The list says that BCS has drivers of type 4, but that's only for SQL ... > Server, not MS Access... ...
    (comp.lang.java.databases)
  • Re: JDBC Driver: Connection reset by peer: socket write error
    ... > and the DBMS, or the DBMS had a failure which required it to ... I reboot the server that hosts both JDBC & the SQL ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: Fulltext failure on a 2 node cluster
    ... Server full-text search resource online: "SQL Cluster Resource 'Full Text' ...
    (microsoft.public.sqlserver.clustering)