Atomikos Forum |
|
Hi,
We are using Atomikos Transaction Essentials 3.7.0 in a Tomcat 6 with JDK 1.6, accessing an Oracle 10g database with ojdbc6.jar lib. The configuration was made following the tips on http://www.atomikos.com/Documentation/Tomcat6Integration35. Resource configuration is as follow: ------------>8------------>8------------>8------------ <Resource name="jdbc/pad" type="com.atomikos.jdbc.AtomikosDataSourceBean" factory="br.jus.trepr.transacao.BeanFactory" uniqueResourceName="pad_jdbc_pad" xaDataSourceClassName="oracle.jdbc.xa.client.OracleXADataSource" minPoolSize="10" maxPoolSize="100" testQuery="SELECT 1 FROM DUAL" xaProperties.URL="jdbc:oracle:thin:@xxx:1521:xxx" xaProperties.user="xxx" xaProperties.password="xxx" /> ------------8<------------8<------------8<------------ Just before a container start, the connections and transactions managements works pretty good, but after some time, normally something between 2-7 days running, the connection pool starts to be corrupted. Pool can't maintain 10 minimal connections stablisheds and applications logs several times the error message "com.atomikos.jdbc.AtomikosSQLException: Transaction is marked for rollback only or has timed out". This error occurs with methods with or without transaction management, and the unique workaround we find is a stop-start on Tomcat. If someone could help me with this issue I will be very grate. Bellow is one sample of stacktrace for this error on a method without transaction: ------------>8------------>8------------>8------------ SEVERE: Ocorreu um erro ao tentar carregar colecao br.jus.trepr.pad.objetos.Documento com.atomikos.jdbc.AtomikosSQLException: Transaction is marked for rollback only or has timed out at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:44) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:214) at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:138) at $Proxy127.prepareStatement(Unknown Source) at ...FactoryOracle8.recuperaDados(FactoryOracle8.java:99) at ...FactoryOracle8.recupera(FactoryOracle8.java:798) at ...Factory.getColecao(Factory.java:71) at ...Matrix.getColecao(Matrix.java:619) at ...DocumentoFinder.findbyID(DocumentoFinder.java:24) at ...DocumentoNegocio.localizarDocumentoPeloID(DocumentoNegocio.java:148) at ...GerenciadorPAD.localizarDocumentoPeloID(GerenciadorPAD.java:491) at org.apache.jsp.documento.pasta_005ftrabalho.form_005fassinar_005feletronicamente_jsp._jspService(form_005fassinar_005feletronicamente_jsp.java:101) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: com.atomikos.datasource.xa.session.InvalidSessionHandleStateException: Transaction is marked for rollback only or has timed out at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:59) at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:85) at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:176) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:204) ... 30 moreLogging sources ------------8<------------8<------------8<------------ Thanks in advance and sorry for any english mistakes. Claudio Weiler
Hi,
A possible explanation for this would be a pending transaction on some thread, where that thread is reused for some non-transactional methods afterwards. So please verify that all transactions are either committed or rolled back by your application. Alternatively, you might enable threaded 2 phase commit (in jta.properties). HTH
Hi Guy,
Ok, I will review all our begin-commit/rollback controls. About the 2 phase commit, I'm not sure about it, I read some entries on www about configuring 2pc, and it apears to need some aditional configurations. I'm safe to just turn 'com.atomikos.icatch.threaded_2pc' to 'true' or I will need make aditional configurations? Thanks!! |