Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29

I didn't know where to write something about this and decided to do it here.

After loooong time debugging my program I could find out that calling Driver.getConnection(string, string, string) hangs the calling thread. Why(?), I really don't know, but I could find out that this happens with java 1.6.0_29 and not with java 1.6.0_26.

Full enviroment:

  • OS: Tested on both redhat 6.1 and Windows 2008

  • Driver: MS SQL Server JDBC Driver version 3.0.1301.101

  • Java Versions: 1.6.0_26 and 1.6.0_29

As I previously told it works with 1.6.0_26.

Is there anyone that has any idea what's possibly causing this? Maybe some developer? :p

Best regards,

Rui

like image 798
rpvilao Avatar asked Oct 20 '11 19:10

rpvilao


1 Answers

I encountered exactly the same behaviour:

I use both Oracle XE and MS SQL Server Express on my Windows 7 64bit PC - I upgraded to java 1.6.0_29 from 1.6.0_27 (the x64 version) and was surprised to see that the same programs where able to connect to Oracle XE but not to MS SQL Server...

I traced down the problem to javax.sql.DataSource.getConnection() where it was hanging forever - because this is just an interface, the jdbc drivers raised my suspicion...

I'm using the MS SQL Server JDBC Driver 3.0.1301.202 and I even updated to SQL Server CTP (the "community technical preview") 4.0.1722.1 because my suspicion was that it has to do something with the jdbc driver - but no success: still hanging!

My workaround was to downgrade to 1.6.0_27 and -- bang: everything was fine again!

best regards Erich

like image 169
Erich Siffert Avatar answered Oct 21 '22 02:10

Erich Siffert