This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.