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)
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.
This is coupled with a number of other issues relating to the portability (or lack thereof)
subselects and default aggregate column/table naming.
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.