JDBC connection with Microsoft SQL Server is not restored

I have a database that is connected to an unreliable network connection to the application server, so sometimes connections are interrupted. Each time this happens, all database connections in the AP pool must be reconnected, which, unfortunately, is not performed.

I looked at various settings of c3p0, dbcp and bonecp as pools, and also used JTDS, as well as the SQL Server V3 driver (I even tried to collect pools to check if a regular DataSource could create a new uncooled connection - which it doesn't have), but all configuration options do not seem to be able to recover from a network failure.

To clarify, none of the DataSources could get a new connection. Is there any inherent problem with MS Sql server for reconnecting? Did I miss something fundamental here?

I understand that this may not be very useful, but as an example, this is a 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 name="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> 
+4
source share

All Articles