Results 1 to 3 of 3

Thread: Distributed transaction -- JMS Queue --> EHCache -->Database

  1. #1

    Default Distributed transaction -- JMS Queue --> EHCache -->Database

    hi guys

    I have a scenario where my JMS receiver is receiving a message from a active mq 'queue' storing it in cache (ehcahce) and saving some of the messages in the database table.


    I want to use spring distributed transaction but not sure how to proceed

    The tasks are
    JMS receiver gets message from Active MQ queue
    Save/update the message in EhCache
    Save/update the message in SQL Server using hibernate
    Commit/rollback the database transaction
    commit/rollback the message transaction

    Do i use Spring JTATransactionManager? I am using spring 3.0
    Since the database save/update is performed using Hibernate, can i use JTATransactionManager instead of HibernateTransactionManager?
    Do i have to use transacted session in my JMS Receiver? something like : Session session = connection.createSession(TRANSACTED, Session.AUTO_ACKNOWLEDGE);

    any help appreciated
    thanks
    Last edited by jaggernat; Jun 10th, 2011 at 10:31 PM.

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,854

    Default

    I think you will probably find all the information you need, covering several options in this article:
    http://www.javaworld.com/javaworld/j...nsactions.html

    Hope that helps.
    -Mark

  3. #3

    Default

    I alaready read that twice. unfortunately the link doesnt answer my questions. Specifically my questions are:
    1. Since the database save/update is performed using Hibernate, If i use JTATransactionManager, what should be my 'hibernate.transaction.factory_class' value and what should be my 'hibernate.transaction.manager_lookupclass' value?

    2. If i use JTATransactionManager can i still apply the transaction to my methods using spring AOP ?something like
    <tx:advice id="txAdvice" transaction-manager="websphereUOWTransactionManager">
    <tx:attributes>
    ...
    </tx..>


    thanks for the response.

Posting Permissions

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