Back Forum Reply New

Embedding a Transaction within another transaction

Hi

I am pulling data from a JMS Queue. I acknowledge receipt of the message via SESSION_TRANSACTED mode once I have completed processing the message.

Whilst processing the message I am making 3 calls to different stored procedures in a database. I am planning on wrapping the 3 stored procedure calls with a Spring managed transaction - org..jdbc.datasource.DataSourceTran  sactionManager.

Since dequeueing the items from the JMS queue is working within a different  transaction, I just wanted to ensure that by having an embedded Spring transaction this will not create any issues.

In a nutshell, is it OK to have a transaction embedded in another transaction

Thanks

This all depends on your transaction manager setup.

If you really want these to be independent transactions (i.e. the message is sent whether or not the database update succeeds, and vice versa) this should work as long as each quot;sidequot; (JMS and DB) has its own dedicated transaction manager.

If you want the database changes to be affected by rollbacks in the JMS stuff (or vice versa), you'll probably need to use a single distributed/JTA transaction.

Hope this helps
- Don
¥
Back Forum Reply New