Results 1 to 2 of 2

Thread: Transaction spanning across many objects in the system

  1. #1
    Join Date
    Sep 2005
    Posts
    16

    Default Transaction spanning across many objects in the system

    I am building an application which has the following flow:

    webservice1 --> jmsqueue1 --> mdb1 --> jmsqueue2 --> mdb2 --->...

    webservice1 - receives a SOAP search request, inserts the request into the database, and sends a jms message containing the unique id to jmsqueue1.
    mdb1 - reads from jmsqueue1, does some processing, and sends the jms message containing the unique id to jmsqueue2.
    mdb2 - reads from jmsqueue2, goes to the database to retrieve the search request, and does some kind of processing

    My question is: using Spring AOP or other technologies is it possible to have a transaction spanning across all of the components described aboved, so that if an error occurs on mdb2 then a rollback will occur on jmsqueue2, mdb1, jmsqueue1, webservice1? I'm not sure if what I'm describing is even possible. Does anyone have any suggestions?

    Thanks in advanced!

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    You can use Spring's transaction API (either programmatically or, preferred, declaratively). However, note that Spring does not provide a transaction monitor implementation but rather allows you to choose an existing one.

    So in your case you have to ensure to choose a transaction manager that supports distributed transaction. If you use JtaTransactionManager inside an application server you would be just fine (ensure to use XA datasources for database access).

    Regards,
    Andreas

Similar Threads

  1. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  2. Replies: 3
    Last Post: May 16th, 2005, 07:04 AM
  3. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  4. Replies: 8
    Last Post: Sep 23rd, 2004, 01:12 AM
  5. Transaction pb Hibernate/MySQL
    By syluser in forum Data
    Replies: 2
    Last Post: Aug 28th, 2004, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •