Bug #65085 Getting XAER_RMFAIL exception with global transaction in ACTIVE status
Submitted: 24 Apr 2012 6:12 Modified: 24 May 2012 21:27
Reporter: Yogesh Sakurikar Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: XA transactions Severity:S2 (Serious)
Version:5.5.12 OS:Linux (mysql driver 5.1.19)
Assigned to: CPU Architecture:Any
Tags: hibernate, MySQL, xa, XAER_RMFAIL

[24 Apr 2012 6:12] Yogesh Sakurikar
Description:
Hi,
  We are getting an issue while calling a sp in mysql. The same proc works fine when we use local tx, however with xa, it throws error while running the sp from java with hibernate.

  After googling, it states that the issue comes due to the implicit commits, however there are no implicit commits in it.

Here are the param we use in mysql ds:
<xa-datasource>
        <jndi-name>jdbc/NewP</jndi-name>
        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
        <xa-datasource-property name="URL">jdbc:mysql://localhost/local_primary</xa-datasource-property>
        <xa-datasource-property name="User">user1</xa-datasource-property>
        <xa-datasource-property name="Password">mysql111</xa-datasource-property>				
        <xa-datasource-property name="zeroDateTimeBehavior">convertToNull</xa-datasource-property>
        <min-pool-size>5</min-pool-size>
        <max-pool-size>150</max-pool-size>
		<new-connection-sql>set sql_mode=''</new-connection-sql>
		<!--track-connection-by-tx>true</track-connection-by-tx>
        <no-tx-separate-pools>true</no-tx-separate-pools-->
        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
        <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
        <metadata>
          <type-mapping>mySQL</type-mapping>
        </metadata>
</xa-datasource>

Is there any other param, that we should use?

Thanks, Yogesh

How to repeat:
Call the sp from hibernate, and use the above mysql ds, it will be reproducible.
[24 Apr 2012 21:27] Sveta Smirnova
Thank you for the report.

Please provide repeatable test case for this issue.
[25 May 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[19 Sep 2017 2:13] Kylin Soong
Caused by: java.sql.SQLException: XAER_RMFAIL: The command cannot be executed when global transaction is in the  ACTIVE state
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2531)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2489)
	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:848)
	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:742)
	at com.mysql.jdbc.jdbc2.optional.StatementWrapper.execute(StatementWrapper.java:629)
[19 Sep 2017 2:14] Kylin Soong
I Hit the same issue just now, and submit the Exception Trace in above