java - Long running JDBC transaction: Closed Connection -
i using c3p0 connection pooling , facing "closed connection" error large data sets. expect transaction atomic , run max 2 hours.
for large data sets, take around 40-45 minutes in processing. when try persist data in db, exceptions in following sequence:
[warn] [c3p0] pooledconnection has signalled connection error still in use! [warn] [c3p0] error has occurred [ java.sql.sqlrecoverableexception: closed connection ] not reported listeners! [error] org.hibernate.transaction.jdbctransaction: 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 rollback exception.
i have tried exploring solution lot , tried update configuration accordingly. here 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 dual" /> </bean>
please help.