Announcement Announcement Module
Collapse
No announcement yet.
Implementing Distributed transactions using Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Implementing Distributed transactions using Spring

    Hello

    I am looking for a good/simple sample on implementing a distributed transaction spanning 2 transactional resources - Spring JDBC & Spring JMS, using Spring JDBC/JMS template and PlatformTransactionManager. The requirement is to publish a message to the JMS queue only when the db update is successful. I can think of 2 options:

    Option-1
    Include DB update and JMS message publishing within one transaction.
    Can someone point me to some sample implementation?

    Option-2
    Publish the message only after the DB update is committed - outside of the DB transaction. The problem here is what if the message publishing fails?


    Thanks
    Chandru

  • #2
    Hi, you might take a look at this blog for information on how to configure Spring and JTA, complete with samples.


    Originally posted by cganesan View Post
    Hello

    I am looking for a good/simple sample on implementing a distributed transaction spanning 2 transactional resources - Spring JDBC & Spring JMS, using Spring JDBC/JMS template and PlatformTransactionManager. The requirement is to publish a message to the JMS queue only when the db update is successful. I can think of 2 options:

    Option-1
    Include DB update and JMS message publishing within one transaction.
    Can someone point me to some sample implementation?

    Option-2
    Publish the message only after the DB update is committed - outside of the DB transaction. The problem here is what if the message publishing fails?


    Thanks
    Chandru

    Comment

    Working...
    X