JDK-7103886 : 6.0 u27 upgraded to u29: JDBC for SQLServer hangs on connect
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6u26
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2008
  • CPU: x86
  • Submitted: 2011-10-22
  • Updated: 2012-03-20
  • Resolved: 2011-11-01
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Defect-version: java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

Version-ok: java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Win Server 2008 R2, amd64

EXTRA RELEVANT SYSTEM CONFIGURATION :
SQL Server 2008 R2 Standard Edition
Latest JDBC 4.0 Driver package from Microsoft

A DESCRIPTION OF THE PROBLEM :
The code fragment below produces a complete hang (10 minutes+ in the test) of the thread that is executing it when being executed with 1.6.0_29 release. In 1.6.0_27 everything was fine.

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection(
"jdbc:sqlserver://localhost:1433","sa","password");
System.out.println("connected");

Both releases have been installed with no further customizations, tests have been perfomed with identical 3-party JAR files.  If SQL Server is shut down (and the socket is closed on 1433) while the program is running under 1.6.0_29 DriverManager.getConnection bails out with an exception.

REGRESSION.  Last worked in version 6u26


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Downgrade to JRE/JDK 6.0 Update 27