Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lost connection detection time difference

 
Neil Gow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Having a problem understanding why a broken JDBC connection is detected under Windows much quicker than it is under Linux.

I have an process that opens a connection to MSSQL using JDBC, a Stored Procedure is then executed and the result set
processed, this execute step is repeated every 60 seconds or so. If any exception is thrown then resources are closed, sleep
for 60 seconds, the connection is reopened (if fails then sleeps and repeats), once reopened the process continues. There is logging throughout
the above steps.

On Windows Vista 64bit Sun Java platform the process runs fine, if I deliberately break the connection (stop MSSQL service), the process
logs a problems within 60 seconds and starts handling the error, when the MSSQL comes back then within 60 seonds the connection is remade
and the process continues as expected.

Under Ubuntu 10 64bit both Sun and OpenJDK the process runs fine, until the connectionis broken, as it takes about 17 minutes for the exception to be thrown
for the connection broken (stopped MSSQL), as opposed to under Windows taking seconds. Once detected then the process works as expected, retrying
and reconnecting as it should.

What could be the reason for the time difference in the lost connection detection between Windows and Linux? Any help tips would be most welcome.

Thanks.

 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the same protocol to connect in the two systems?
 
Neil Gow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the code and the connection paramters are identical, both windows and linux are connecting to the same mssql db on the same server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic