I'm using a java framework named s2jdbc belongs to seasar2. It worked well in Sql Server 2008 R2 SP1(10.50.2500), but when it comes to Sql Database in Azure(11.0.9213), jdbc error 08S01 sometimes happens.
Usually, when s2jdbc wants to get a connection from pool, it executes a sql "SELECT 1" to verify if the connection is alive. But sometimes it seems be disconnectted by sql server. After more than 15 minutes, a timeout exception is through out by sqlserver jdbc. There is a commandTimeout be setting to 10 minutes or less, but not worked. Here is the stack trace. (Sorry in Japanese)
org.seasar.framework.exception.SSQLException: [ESSR0072]SQLで例外(SQL=[select 1], Message=[0], ErrorCode=08S01, SQLState={3})が発生しました
at org.seasar.extension.jdbc.impl.PreparedStatementWrapper.wrapException(PreparedStatementWrapper.java:72)
at org.seasar.extension.jdbc.impl.PreparedStatementWrapper.wrapException(PreparedStatementWrapper.java:67)
at org.seasar.extension.jdbc.impl.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:83)
at org.seasar.extension.dbcp.impl.ConnectionPoolImpl.validateConnection(ConnectionPoolImpl.java:404)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 接続がタイムアウトしました
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1339)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1654)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:3694)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:5022)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:388)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:340)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
The above message "接続がタイムアウトしました" means, connection timed out.
And, my server is running on CentOS 6.5.
Any advises, and thank you in advance.
Exactly what it says on the tin, connection timed out. If there were no issues with DB you can try and reboot Centos box as a first port of call. Ask Azure team(raise a support ticket) to move the Centos VM to another hypervisor if this issue happens often.