14 Replies Latest reply on Feb 11, 2020 6:16 AM by ochaloup

    ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL

    hasancansaral

      Using jbpm-spring-boot-starter-basic in a Spring Boot project, which in return brings Naryana as the transaction manager. My database is Oracle 11g Release 2, and I am receiving the following exception:

       

      org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT S.SESSION_ID, S.CREATION_TIME, S.LAST_ACCESS_TIME, S.MAX_INACTIVE_INTERVAL, SA.ATTRIBUTE_NAME, SA.ATTRIBUTE_BYTES FROM SPRING_SESSION S LEFT OUTER JOIN SPRING_SESSION_ATTRIBUTES SA ON S.SESSION_ID = SA.SESSION_ID WHERE S.SESSION_ID = ?]; SQL state [null]; error code [0]; ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed; nested exception is java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed
        at org
      .springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.session.jdbc.JdbcOperationsSessionRepository$3.doInTransaction(JdbcOperationsSessionRepository.java:491) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]
        at org
      .springframework.session.jdbc.JdbcOperationsSessionRepository$3.doInTransaction(JdbcOperationsSessionRepository.java:488) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]
        at org
      .springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.session.jdbc.JdbcOperationsSessionRepository.getSession(JdbcOperationsSessionRepository.java:488) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]
        at org
      .springframework.session.jdbc.JdbcOperationsSessionRepository.getSession(JdbcOperationsSessionRepository.java:130) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]
        at org
      .springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:332) ~[spring-session-1.3.5.RELEASE.jar:na]
        at org
      .springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:349) ~[spring-session-1.3.5.RELEASE.jar:na]
        at org
      .springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:221) ~[spring-session-1.3.5.RELEASE.jar:na]
        at javax
      .servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:241) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
        at javax
      .servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:241) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .springframework.security.web.authentication.WebAuthenticationDetails.<init>(WebAuthenticationDetails.java:53) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.authentication.WebAuthenticationDetailsSource.buildDetails(WebAuthenticationDetailsSource.java:42) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.authentication.WebAuthenticationDetailsSource.buildDetails(WebAuthenticationDetailsSource.java:30) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.authentication.AnonymousAuthenticationFilter.createAuthentication(AnonymousAuthenticationFilter.java:117) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:97) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:171) ~[spring-session-1.3.5.RELEASE.jar:na]
        at org
      .springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80) ~[spring-session-1.3.5.RELEASE.jar:na]
        at org
      .apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:394) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.StandardHostValve.status(StandardHostValve.java:253) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:348) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:173) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at org
      .apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]
        at org
      .apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.27.jar:9.0.27]
        at java
      .lang.Thread.run(Thread.java:748) [na:1.8.0_162]
      Caused by: java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed
        at com
      .arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:961) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]
        at com
      .arjuna.ats.internal.jdbc.ConnectionImple.prepareStatement(ConnectionImple.java:173) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]
        at org
      .springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1556) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        at org
      .springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
        
      ... 64 common frames omitted

       

      This doesn't happen with MySQL. I'm a little blind here, how do I further debug/resolve this?

        • 1. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
          mmusgrov

          I think the actual failure occurs because the method narayana/TransactionImple.java at master · jbosstm/narayana · GitHub returns false.

          Would it be possible for you to turn in trace logging to see where in that method the failure occurs?

          • 2. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
            hasancansaral

            Hi Michael, here's a lengthier stack trace:

             

            2020-02-06 16:41:00.003  WARN 9916 --- [  scheduling-1] com.arjuna.ats.jta                      : ARJUNA016061: TransactionImple.enlistResource - XAResource.start returned: XAException.XAER_PROTO for < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff7f000101:8b45:5e3c169a:16, node_name=1, branch_uid=0:ffff7f000101:8b45:5e3c169a:17, subordinatenodename=null, eis_name=0 >

             

            oracle.jdbc.xa.OracleXAException: null

            at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1110) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0]

            at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0]

            at com.arjuna.ats.internal.jdbc.IsSameRMOverrideXAResource.start(IsSameRMOverrideXAResource.java:66) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:662) ~[jta-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:940) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jdbc.ConnectionImple.prepareStatement(ConnectionImple.java:173) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1556) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:862) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:917) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:927) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:571) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:568) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository.cleanUpExpiredSessions(JdbcOperationsSessionRepository.java:568) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_162]

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_162]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_162]

            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_162]

            at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]

            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]

             

            2020-02-06 16:41:00.004  WARN 9916 --- [  scheduling-1] com.arjuna.ats.jta                      : ARJUNA016138: Failed to enlist XA resource com.arjuna.ats.internal.jdbc.IsSameRMOverrideXAResource@3abf7efc

             

            oracle.jdbc.xa.OracleXAException: null

            at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1110) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0]

            at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240) ~[ojdbc6-11.2.0.4.jar:11.2.0.4.0]

            at com.arjuna.ats.internal.jdbc.IsSameRMOverrideXAResource.start(IsSameRMOverrideXAResource.java:66) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:662) ~[jta-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:940) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jdbc.ConnectionImple.prepareStatement(ConnectionImple.java:173) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1556) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:862) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:917) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:927) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:571) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:568) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository.cleanUpExpiredSessions(JdbcOperationsSessionRepository.java:568) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_162]

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_162]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_162]

            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_162]

            at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]

            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]

             

            2020-02-06 16:41:00.005 DEBUG 9916 --- [  scheduling-1] s.j.s.SQLErrorCodeSQLExceptionTranslator : Unable to translate SQLException with Error code '0', will now try the fallback translator

            2020-02-06 16:41:00.005 DEBUG 9916 --- [  scheduling-1] o.s.t.support.TransactionTemplate        : Initiating transaction rollback on application exception

             

            org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [DELETE FROM SPRING_SESSION WHERE MAX_INACTIVE_INTERVAL < (? - LAST_ACCESS_TIME) / 1000]; SQL state [null]; error code [0]; ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed; nested exception is java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed

            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:862) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:917) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:927) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:571) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:568) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository.cleanUpExpiredSessions(JdbcOperationsSessionRepository.java:568) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_162]

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_162]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_162]

            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_162]

            at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]

            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]

            Caused by: java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed

            at com.arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:961) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jdbc.ConnectionImple.prepareStatement(ConnectionImple.java:173) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1556) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            ... 22 common frames omitted

             

            2020-02-06 16:41:00.006  WARN 9916 --- [  scheduling-1] com.arjuna.ats.jta                      : ARJUNA016087: TransactionImple.delistResource - unknown resource

            2020-02-06 16:41:00.006 DEBUG 9916 --- [  scheduling-1] o.s.jdbc.datasource.DataSourceUtils      : Could not close JDBC Connection

             

            java.sql.SQLException: ARJUNA017011: Delist of resource failed.

            at com.arjuna.ats.internal.jdbc.ConnectionImple.close(ConnectionImple.java:303) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at org.springframework.jdbc.datasource.DataSourceUtils.doCloseConnection(DataSourceUtils.java:360) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:347) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:314) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.datasource.DataSourceUtils$ConnectionSynchronization.beforeCompletion(DataSourceUtils.java:479) [spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCompletion(TransactionSynchronizationUtils.java:107) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCompletion(AbstractPlatformTransactionManager.java:933) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:824) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:810) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:168) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:144) [spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository.cleanUpExpiredSessions(JdbcOperationsSessionRepository.java:568) [spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_162]

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_162]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_162]

            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_162]

            at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]

            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]

             

            2020-02-06 16:41:00.006 DEBUG 9916 --- [  scheduling-1] o.s.t.jta.JtaTransactionManager          : Initiating transaction rollback

            2020-02-06 16:41:00.006 ERROR 9916 --- [  scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task

             

            org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [DELETE FROM SPRING_SESSION WHERE MAX_INACTIVE_INTERVAL < (? - LAST_ACCESS_TIME) / 1000]; SQL state [null]; error code [0]; ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed; nested exception is java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed

            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:862) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:917) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:927) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:571) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:568) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.session.jdbc.JdbcOperationsSessionRepository.cleanUpExpiredSessions(JdbcOperationsSessionRepository.java:568) ~[spring-session-1.3.5.RELEASE.jar:2.2.0.RELEASE]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_162]

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_162]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_162]

            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_162]

            at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_162]

            at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_162]

            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_162]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_162]

            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_162]

            Caused by: java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed

            at com.arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:961) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at com.arjuna.ats.internal.jdbc.ConnectionImple.prepareStatement(ConnectionImple.java:173) ~[jdbc-5.9.0.Final.jar:5.9.0.Final]

            at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1556) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]

            ... 22 common frames omitted

            • 3. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
              tomjenkinson

              mmusgrov  would you agree according to XA 6.2 then it suggests xa_start is being called on a resource that is already enlisted with a thread?

               

              hasancansaral do you have trace logging from Narayana? Is it reproducible?

              • 4. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                mmusgrov

                tomjenkinson I would agree that XAXAException.XAER_PROTO would be returned if we call xa_start when it's already enlisted. But there are other reasons for XAER_PROTO. The narayana code in TransactionImple#enlistResource does do a check to see if the resource is already associated.

                 

                hasancansaral have you managed to run any XA transactions against the oracle database or does it always fail?

                Has the db been configured to use XA?

                How do you configure Spring to use XA?

                It would be useful to see some trace logging.

                Are there any Oracle XA logs that show the sequence of XA calls (16 Using Oracle XA with Transaction Monitors ) that show the error?

                • 5. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                  hasancansaral

                                

                         docker pull wnameless/oracle-xe-11g-r2

                         docker run -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g-r2

                                

                                 # Create a user temp_user with temp_password:

                   

                                 CREATE USER temp_user IDENTIFIED BY temp_password;

                                 GRANT CREATE SESSION TO temp_user;

                                 GRANT CREATE TABLE TO temp_user;

                                 GRANT UNLIMITED TABLESPACE TO temp_user;

                   

                                 ALTER SESSION SET CURRENT_SCHEMA = temp_user;

                   

                  CREATE TABLE spring_session

                  (

                     session_id CHAR(36) NOT NULL,

                     creation_time NUMBER(19,0) NOT NULL,

                     last_access_time NUMBER(19,0) NOT NULL,

                     max_inactive_interval NUMBER(10,0) NOT NULL,

                     principal_name VARCHAR2(100 CHAR),

                     CONSTRAINT spring_session_pk PRIMARY KEY (session_id)

                  );

                   

                  CREATE INDEX spring_session_ix1 ON spring_session (last_access_time);

                  CREATE INDEX spring_session_ix2 ON spring_session (principal_name);

                   

                  CREATE TABLE spring_session_attributes

                  (

                     session_id CHAR(36) NOT NULL,

                     attribute_name VARCHAR2(200 CHAR) NOT NULL,

                     attribute_bytes BLOB NOT NULL,

                     CONSTRAINT spring_session_attributes_pk PRIMARY KEY (session_id, attribute_name),

                     CONSTRAINT spring_session_attributes_fk FOREIGN KEY (session_id) REFERENCES spring_session (session_id) ON DELETE CASCADE
                  );

                   

                  CREATE INDEX spring_session_attributes_ix1 ON spring_session_attributes (session_id);

                   

                  and simply clone GitHub - hasancansaral/oracle-xa-spring-boot  and run it. Apart from that, I don't know how I can provide further output/stacktrace. I ran the application with logging.level.root=DEBUG and the above stacktrace is printed. How can I provide further info?

                  • 6. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                    tomjenkinson

                    Hi Hasan,

                     

                    What is the "wnameless" docker hub DB? It doesn't seem official - I see it referred to here: Oracle 11g in Linux docker container | Oracle Community

                     

                    Hope it helps,

                    Tom

                    • 7. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                      hasancansaral

                      Hi thomas.modeneis,

                       

                      It certainly is not. I only made a reference to it for the sake of being able to reproduce the issue within 5 minutes. Normally, we do run Oracle 11g Release 2 Enterprise Edition, with XA enabled (FWIW, I can run XA transactions with Bitronix JTA, both with the "wnameless" docker image, and with our main database).

                       

                      Thanks!

                      • 8. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                        tomjenkinson

                        I see, thanks for the clarification

                         

                        How did you enable "logging.level.root=DEBUG"? I don't spot it in GitHub - hasancansaral/oracle-xa-spring-boot

                        • 9. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                          hasancansaral

                          Sorry, I must have removed it before putting it to github. I've just re-added it.

                          • 11. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                            ochaloup

                            hasancansaral The trouble could be caused by the Oracle database which does not permit to reuse an XAResource from the same connection. Every time a new XAResource has to be asked for. It's the specific behaviour of Oracle. The workaround could be to use system property that chages the default behaviour from Narayana side.

                            Try to run with

                            -Dcom.arjuna.ats.jdbc.common.JDBCEnvironmentBean.defaultIsSameRMOverride=true

                            (or similarly in way how Spring passes the system properties to the starting JVM)

                            • 12. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                              hasancansaral

                              ochaloup Thanks for the answer, but it didn't resolve the issue.

                               

                              tomjenkinson Sorry for the confusion, it was a custom level of logging. Changed it to DEBUG in the repo.

                              • 13. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                                tomjenkinson

                                I think we need see some more logging. I looked in the repo you provided but it doesn't seem to contain the code that has the actual database access. Is it possible to create a smaller reproducer?

                                • 14. Re: ARJUNA017017: enlist of resource failed exception with Oracle 11g Release 2 XE but not with MySQL
                                  ochaloup

                                  hasancansaral  ok, I see. My assumption was not right. I agree with Tom that more logging would be really beneficial.

                                   

                                  To elaborate further on my idea. I think there could be a trouble with Narayana JDBC driver and as it reuse the same connection for the Oracle database. It's just my speculation and I haven't tried to run your code.

                                  But do you think you may try to disable pooling for your example, just for the test?

                                   

                                  I assume your JDBC url will start with 'jdbc:arjuna:', then the url for connecting to database follows. Try to add ';POOL_CONNECTIONS=false' to the url at the end to disable pooling. Does such change make a difference in behavior?

                                   

                                  Then there is one more thing to emphasize. By default the pooling library which is used is Narayana JDBC driver. That one is not recommended for production use as it does not currently provide the best connection pooling capability. It's recommended to use other connection pooling libraries like DBCP2 which is integrated to Spring Boot starter as well. Switching for DBCP2 you need to use property ' narayana.dbcp.enabled=true'. See more at narayana-spring-boot/README.md at master · snowdrop/narayana-spring-boot · GitHub