mismatch between TXID in mysql jdbc2 persistence and Tx.value causes MysqlDataTruncation
----------------------------------------------------------------------------------------
Key: JBAS-6585
URL:
https://jira.jboss.org/jira/browse/JBAS-6585
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JMS (JBossMQ)
Affects Versions: JBossAS-4.2.2.GA
Environment: JBoss 4.2.2.GA with JBossMQ, persistence with
mysql-jdbc2-persistence, running MySQL 5.0.26.
Reporter: Bart Vanhaute
Assignee: Adrian Brock
In the table definitions for the JBossMQ jdbc2 persistence, the type of column TXID is
INT. Under MySQL this is 4-byte integer value. In the code, the value of Tx is of java
type long, a 8-byte value. Obviously, when the Tx becomes bigger than the maximum integer
value, the transaction value cannot be stored anymore in the database, and a
com.mysql.jdbc.MysqlDataTruncation exception is thrown:
2009-03-06 01:27:02,307 WARN [org.jboss.tm.TransactionImpl]
XAException: tx=TransactionImpl:XidImpl[FormatId=257,
GlobalId=blade01-sles-app2.ap/84709294, BranchQual=, localId=84709294]
errorCode=XAER_RMFAIL
org.jboss.mq.SpyXAException: Resource manager error during commit; -
nested throwable: (org.jboss.mq.SpyTransactionRolledBackException:
Transaction was rolled back.; - nested throwable:
(org.jboss.mq.SpyJMSException: Could not remove message: 5702399
2 msg=19226 hard STORED PERSISTENT queue=QUEUE.CAO priority=4
lateClone=false hashCode=1244793572; - nested throwable:
(org.jboss.mq.SpyJMSException: Could not create tx: 2147797249; - nested
throwable: (com.mysql.jdbc.MysqlDataTruncation: Data trunc
ation: Out of range value adjusted for column 'TXID' at row 1))))
at org.jboss.mq.SpyXAException.getAsXAException(SpyXAException.java:72)
at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:92)
at org.jboss.tm.TransactionImpl$Resource.commit(TransactionImpl.java:2253)
at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1784)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:340)
at org.jboss.tm.TxManager.commit(TxManager.java:240)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
at
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
at java.lang.Thread.run(Thread.java:595)
And because the Tx value always keeps incrementing, no further JMS transactions are
possible anymore after this failure. Additionally, restarting the server does not help
either, because the initial value of Tx is determined from the largest stored TXID, which
would already be close to the maximum allowed value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira