1 Reply Latest reply on Jan 14, 2009 1:50 PM by nias

    prepare failed with exception XAException.XAER_RMERR

    nias

      hello,

      i'm using three DS-connections: (the no-tx-datasource was only for databaseloginmodule security)

       <xa-datasource>
       <jndi-name>assek2Datasource</jndi-name>
       <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
       <xa-datasource-property name="ServerName">@db.dev.host@</xa-datasource-property>
       <xa-datasource-property name="PortNumber">@db.dev.port@</xa-datasource-property>
       <xa-datasource-property name="DatabaseName">@db.dev.name@</xa-datasource-property>
       <xa-datasource-property name="User">@db.dev.user@</xa-datasource-property>
       <xa-datasource-property name="Password">@db.dev.password@</xa-datasource-property>
       <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
       <min-pool-size>40</min-pool-size>
       <max-pool-size>50</max-pool-size>
       <track-connection-by-tx/>
       </xa-datasource>
      
       <no-tx-datasource>
       <jndi-name>assek2FipsAfaEmailDatasource</jndi-name>
       <connection-url>jdbc:postgresql://@db.dev.loginhost@</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>@db.dev.loginuser@</user-name>
       <password>@db.dev.loginpassword@</password>
       </no-tx-datasource>
      
       <xa-datasource>
       <jndi-name>assek2AfaDatasource</jndi-name>
       <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
       <xa-datasource-property name="ServerName">@db.dev.afahost@</xa-datasource-property>
       <xa-datasource-property name="PortNumber">@db.dev.afaport@</xa-datasource-property>
       <xa-datasource-property name="DatabaseName">@db.dev.afaname@</xa-datasource-property>
       <xa-datasource-property name="User">@db.dev.afauser@</xa-datasource-property>
       <xa-datasource-property name="Password">@db.dev.afapassword@</xa-datasource-property>
       <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
       <min-pool-size>40</min-pool-size>
       <max-pool-size>50</max-pool-size>
       <track-connection-by-tx/>
       </xa-datasource>
      

      with CMTs.

      For load-tests i'm using soapui-pro.
      if i'm only use 5 threads inside soapui, i can endless call my webservices at maximum speed.
      But if i'm use more then 5 threads for load-tests i got often (2-3%) this errors:
      2009-01-14 18:50:32,796 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] XAResourceRecord.prepare - prepare failed with exception XAException.XAER_RMERR
      2009-01-14 18:50:32,796 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_50] - Prepare phase of action -3f57ffea:c7c6:496e1ab6:dc4b received heuristic decision: TwoPhaseOutcome.HEURISTIC_HAZARD
      2009-01-14 18:50:32,796 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_36] - BasicAction.End() - prepare phase of action-id -3f57ffea:c7c6:496e1ab6:dc4b failed.
      2009-01-14 18:50:32,796 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_37] - Received heuristic: TwoPhaseOutcome.HEURISTIC_HAZARD .
      2009-01-14 18:50:32,796 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_38] - Action Aborting
      

      and as result to the webservice client:
      2009-01-14 18:50:32,846 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
      java.lang.RuntimeException: javax.transaction.HeuristicMixedException
       at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:184)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
       at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:103)
       at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:466)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
       at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:393)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.transaction.HeuristicMixedException
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1397)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
       ... 44 more
      


      i've read many things about these XAResources but don't understand why it works with 5 parallel client but not with more?
      I've checked the size of nearly all jboss.jca.* pools with the jmx-console.
      The resources that enlists in the test-WS are only the databases (no JMS, ..). How can i generate more usefull debugging output?
      Could the limit relies on postgresql configuration?

      Any further ideas?