We are running SQL Server 2008 in a mirrored configuration. Client access is performed using the Microsoft JDBC 2.0 driver, configured to failover to the Mirror in the event the Primary database is unavailable. Additionally, the client maintains
a database connection pool using Apache DBCP's BasicDataSource. During testing, we have found that the failover works flawlessly if either the primary Database is taken offline or the primary SQL Server service is stopped - attempts to use existing pooled
connections to the primary database fail immediately and new connections are created to the mirror database.
However, when simulating a network failure (by disabling the network interface on the SQL Server machine) things aren't so nice. The client first attempts to use an existing pooled connection to the primary database. At this point the client
hangs for up to 15 minutes before failing with the following error:
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Connection timed out
View Complete Post