Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6585

mismatch between TXID in mysql jdbc2 persistence and Tx.value causes MysqlDataTruncation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • JBossAS-4.2.2.GA
    • JMS (JBossMQ)
    • None

    Description

      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.

      Attachments

        Activity

          People

            adrian.brock Adrian Brock (Inactive)
            bartvh_jira Bart Vanhaute (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: