Long running JDBC transaction: Closed Connection
I am using c3p0 for connection pooling and facing "Closed connection"
error with large data sets. I expect my transaction to be atomic and to
run for almost max 2 hours.
For large data sets, which take around 40-45 minutes in processing. When I
try to persist this data in the DB, I get exceptions in the following
sequence:
[WARN] [c3p0] A PooledConnection that has already signalled a Connection
error is still in use!
[WARN] [c3p0] Another error has occurred [
java.sql.SQLRecoverableException: Closed Connection ] which will not be
reported to listeners!
[ERROR] org.hibernate.transaction.JDBCTransaction: Could not toggle
autocommit
java.sql.SQLRecoverableException: Closed Connection
[ERROR] org.hibernate.transaction.JDBCTransaction: JDBC rollback failed
[ERROR]
org.springframework.transaction.interceptor.TransactionInterceptor:
Application exception overridden by rollback exception.
I have tried exploring solution a lot and tried to update my configuration
accordingly. Here is my C3P0 configuration:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${...}" />
<property name="jdbcUrl" value="${...}" />
<property name="user" value="${...}" />
<property name="password" value="${...}" />
<property name="initialPoolSize" value="2" />
<property name="minPoolSize" value="2" />
<property name="maxPoolSize" value="50" />
<property name="maxIdleTime" value="6000" />
<property name="maxIdleTimeExcessConnections" value="1800" />
<property name="idleConnectionTestPeriod" value="3600" />
<property name="checkoutTimeout" value="60000" />
<property name="acquireRetryAttempts" value="0" />
<property name="acquireRetryDelay" value="1000" />
<property name="numHelperThreads" value="1" />
<property name="preferredTestQuery" value="SELECT 1 FROM DUAL" />
</bean>
Please help.
No comments:
Post a Comment