1 Reply Latest reply on Dec 5, 2005 11:07 AM by luc.texier

    JBAS-2425 - Primary key constraint violation

      Here is the full history:

      The original problem was that the recovery did not correctly calculate the maximum
      txid to use as the next txid once the server is started.

      This could lead to non-uniqueness in JMS_TRANSACTIONS

      Fix 1: Calculate MAX(TXID) before it does anything (like rollback failed transactional adds)
      4.0.2: http://jira.jboss.com/jira/browse/JBAS-1583

      Fix 2: Use both the JMS_TRANSACTIONS AND JMS_MESSAGES table to calculate the maximum
      Fix 3: The real fix. Once recovery is complete, the failed transactions should be removed from JMS_TRANSACTIONS, making fix 1 and fix 2 irrelevant.
      4.0.3: http://jira.jboss.com/jira/browse/JBAS-2056

      This is coupled with a number of other issues relating to the portability (or lack thereof)
      subselects and default aggregate column/table naming.

        • 1. Re: JBAS-2425 - Primary key constraint violation
          luc.texier

          since Fix 2 is irrelevant and seems to be a problem with some databases (eg MySQL) shall we revert to the original statement?
          SELECT_MAX_TX = SELECT MAX(TXID) FROM JMS_MESSAGES

          in org.jboss.mq.pm.jdbc2.PersistenceManager, Branch_3_2, Branch_4_0 and HEAD

          We need also to update the examples in /docs/examples/jms. Or we could just update the examples.