localTransactionMode
is set to false (default), and Transaction tx = ...; //start a JTA transaction
... AtomikosConnectionFactoryBean cf = ...; //create or retrieve a connection factory instance
...
Connection c = cf.createConnection();
Session s = c.createSession ( true , 0 ); //note the value of the transacted flag!
...//perform regular JMS sends or receives
...
tx.commit(); //commit JTA transaction to make all JMS operations take effect, or rollback to cancel everything
XAConnectionFactory
is that this class takes care of all JTA/XA-related calls towards the driver underneath. In other words, it hides the complexities of JTA/XA at the driver level. localTransactionMode
is set to true, and AtomikosConnectionFactoryBean cf = ...; //create or retrieve a connection factory instance
...
Connection c = cf.createConnection();
Session s = c.createSession ( true , 0 ); //note the value of the transacted flag!
...//perform regular JMS sends or receives
...
s.commit();//commit on session to make all effects permanent, rollback to cancel
AtomikosConnectionFactoryBean cf = ...; //create or retrieve a connection factory instance
...
Connection c = cf.createConnection();
Session s = c.createSession ( false , ... ); //note the value of the transacted flag!
Note: this mode requires support from your JMS vendor's XAConnectionFactory implementation. Check your vendor documentation first!
|
|