Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1189

Resume for XID raised -5: invalid arguments were given for the XA operation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.3.3
    • 3.4.1
    • XA
    • None
    • OS: Unix based
      JVM: 17.0.9
      External Java libraries: Spring Boot 3.3.1, Atomikos 6.0.0, Hibernate 6.5.2.Final

    Description

      Hi,

      our system depends of two different MariaDB databases and a Message Queue (Apache Artemis) and we are doing XA transaction between them. To implement JTA transactions in Java we use Atomikos.

      When using the MariaDB Connector/J in the version provided by Spring Boot 3.x (v 3.3.3) or higher (v 3.4.0) we get the same errors as stated in a former bug ticket https://jira.mariadb.org/browse/CONJ-122.

      The error message shows as follows:

      com.atomikos.datasource.ResourceException: XA resource 'xaDataSource': resume for XID 'XID: 3139322E3136382E3137382E3130302E746D313731393939353238343032333030303238:3139322E3136382E3137382E3130302E746D3237' raised -5: invalid arguments were given for the XA operation
      	at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:223) ~[transactions-jta-6.0.0-jakarta.jar:na]
      	at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:40) ~[transactions-jta-6.0.0-jakarta.jar:na]
      	at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:46) ~[transactions-jta-6.0.0-jakarta.jar:na]
      	at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:58) ~[transactions-jta-6.0.0-jakarta.jar:na]
      	at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:165) ~[transactions-jta-6.0.0-jakarta.jar:na]
      	at com.atomikos.jdbc.internal.AtomikosJdbcConnectionProxy.enlist(AtomikosJdbcConnectionProxy.java:88) ~[transactions-jdbc-6.0.0-jakarta.jar:na]
      	at com.atomikos.jdbc.internal.AtomikosJdbcConnectionProxy.updateTransactionContext(AtomikosJdbcConnectionProxy.java:61) ~[transactions-jdbc-6.0.0-jakarta.jar:na]
      	at com.atomikos.jdbc.internal.AbstractJdbcConnectionProxy.prepareStatement(AbstractJdbcConnectionProxy.java:64) ~[transactions-jdbc-6.0.0-jakarta.jar:na]
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
      	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
      	at com.atomikos.util.DynamicProxySupport.callProxiedMethod(DynamicProxySupport.java:164) ~[atomikos-util-6.0.0.jar:na]
      	at com.atomikos.util.DynamicProxySupport.invoke(DynamicProxySupport.java:121) ~[atomikos-util-6.0.0.jar:na]
      ...
      ...
      ...
      

      This behavior is also stated by Atomikos here: http://www.atomikos.com/Documentation/KnownProblems#MySQL_does_not_support_TMJOIN

      The method to fix this was setting a connection string parameter:

      pinGlobalTxToPhysicalConnection="true"
      

      This parameter was removed in the newer MariaDB Connector/J versions as stated here: MariaDB Connector/J 2.7 -> 3.4 Upgrade

      Using the Mysql Connector/J driver with MariaDB and the mentioned parameter works as intended but introduces other problems (e.g. Hibernate not recognizing the right dialect and giving warnings due to not resolve the right DB version etc.)

      Please reintroduce the parameter

      pinGlobalTxToPhysicalConnection
      

      or give us another posibility to get along with this issue.

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              gbalthasar Gregor Balthasar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.