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:
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
  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-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>
		<new-connection-sql>set sql_mode=''</new-connection-sql>

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