java - Spring transaction not rolling back due to closed connection -


i have pretty large transaction, annotated @transactional. there few long-running queries in it, runs fine. 20% of time connection appears getting forcibly closed outside of transaction, , when transaction tries continue doing work, fails following stack trace. worse, transaction not rolling back.

jdbc commits default on connection close. however, spring should setting connection's auto-commit false using following before opening transaction (spring @transactional , jdbc autocommit). i've confirmed version using still this. use simplejdbctemplate execute queries , connections obtained apache commons dbcp pool.

is issue dbcp thinks connection stale (as transaction has few long-running queries in it) , pool tries reclaim connection, committing along way? shouldn't autocommit=false prevent this? have other suggestions?

thanks

using (all pretty old):

springjdbc 2.5 oracle jdbc drivers 11.1.0.7 (ojdbc6) apache commons dbcp 1.2.1 

stack trace:

activity threw exception:  org.springframework.transaction.transactionsystemexception: not roll jdbc transaction; nested exception java.sql.sqlexception: connection oracle.jdbc.driver.t4cconnection@56a2191a closed. @ org.springframework.jdbc.datasource.datasourcetransactionmanager.dorollback(datasourcetransactionmanager.java:279) @ org.springframework.transaction.support.abstractplatformtransactionmanager.processrollback(abstractplatformtransactionmanager.java:800) @ org.springframework.transaction.support.abstractplatformtransactionmanager.rollback(abstractplatformtransactionmanager.java:777) @ org.springframework.transaction.interceptor.transactionaspectsupport.completetransactionafterthrowing(transactionaspectsupport.java:339) @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:110) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:202) [...] caused by: java.sql.sqlexception: connection oracle.jdbc.driver.t4cconnection@56a2191a closed. @ org.apache.commons.dbcp.delegatingconnection.checkopen(delegatingconnection.java:398) @ org.apache.commons.dbcp.delegatingconnection.rollback(delegatingconnection.java:368) @ org.apache.commons.dbcp.poolingdatasource$poolguardconnectionwrapper.rollback(poolingdatasource.java:323) @ org.springframework.jdbc.datasource.datasourcetransactionmanager.dorollback(datasourcetransactionmanager.java:276) ... 21 more 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -