1 Reply Latest reply on Oct 10, 2005 10:21 AM by timfox

    Major transaction refactoring

    timfox

      Hi

      I have check in some fairly major changes that solve several major outstanding issues in JBoss Messaging.

      I have refactored most of the transaction management in the product. This includes removal of the JTA transaction manager we were using to manage local transactions, and it's replacement with a "TransactionRepository". I have also implemented the persistence of transactions to the db.

      This works similarly to JBossMQ where items inserted during the transaction are added with flag "A" (or "D" if they are deleted), and on transaction commit/rollback the state is resolved as appropriate.

      Our case is somewhat more complex than jbossmq since we have 2 tables that store transactional state, delivery and message_reference but the basic principle is the same.

      Transactional operations now accept a Transaction object as a param, this represents the JMS server local transaction and it maintains the transactional state, this has involved changing the interfaces of Receiver, Router and DeliveryObserver.

      I have also made changes to our message storage, which require channels to take over responsibility for referencing messages, this mean channels only really deal with message references now, meaning channel state only stores messgerefernces (previously channel state would store actually messages if that was what was passed in - causing memory problems).

      I think some big parts of this project are coming into shape now, and it's looking cleaner and more elegant IMHO. :)

      BTW I have tagged the jms module with "before-tx-refactoring" before committing these changes