RE: BUG: JDBC connection disconnected, can't reconnect
- From: Marco <Marco@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Jun 2008 02:54:00 -0700
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.
- Prev by Date: Re: JDBC Performance is no where near .NET performance (JDBC 1.2 against mssql2008)
- Previous by thread: RE: SQL Server 2005, jdbc error/bug?
- Index(es):
Relevant Pages
|