JDBC connection to Microsoft SQL Server doesn't reconnect
I have a database that is connected through an unreliable network connection to an application server, so occasionally the connections break down. Each time this happens, all database connections in the AP pool will need to reconnect - which they don't unfortunately.
I went through different setups of c3p0, dbcp and bonecp as pools and used JTDS as well as the SQL Server V3 driver, (I even ditched pooling atogether to try out whether the regular DataSource would be able to create a new unpooled connection - which it didn't) but all configuration variants don't seem able to recover after network failure.
To clarify, none of the DataSources were able to get a new Connection. Is there some inherent Problem with the MS Sql Server regarding reconnects? Am I missing something fundamental here?
I realize this might not be of big help, but just as an example this is the dbcp configuration
<bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.databaseurl}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="idleConnectionTestPeriodInMinutes" value="1" />
<property n开发者_运维百科ame="idleMaxAgeInMinutes" value="1" />
<property name="maxConnectionsPerPartition" value="3" />
<property name="minConnectionsPerPartition" value="1" />
<property name="partitionCount" value="1" />
<property name="acquireIncrement" value="5" />
<property name="acquireRetryAttempts" value="50" />
<property name="acquireRetryDelayInMs" value="1000" />
<property name="queryExecuteTimeLimitInMs" value="5000" />
<property name="connectionTestStatement" value="SELECT count(*) FROM dbo.sysobjects" />
<property name="closeConnectionWatch" value="true" />
<property name="lazyInit" value="false" />
<property name="statementsCacheSize" value="100" />
<property name="releaseHelperThreads" value="3" />
</bean>
精彩评论