Announcement Announcement Module
Collapse
No announcement yet.
JPA with JTA : which transaction manager should I use ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JPA with JTA : which transaction manager should I use ?

    I'm using JPA with transaction-type = JTA, and I'm wondering how I must define the transactionManager bean:
    1. JtaTransactionManager (or in my particular case, WebsphereUowTransactionManager)
    2. JpaTransactionManager
    My first thought would be to use the JtaTransactionManager, but in my application, the entity manager is created and managed on the web layer (I'm using spring webflow flow-persistence), and as a consequence, the entity manager is open even where there is no active transaction. When a transactional service is eventually invoked, the entity manager has to join the JTA transaction, with an explicit call to EntityManager.joinTransaction(). Only JpaTransactionManager can invoke this method.

    Thanks for your interest in my question.

  • #2
    Just a quick question:

    You are using more then one datasource?

    Cheers

    Comment


    • #3
      Currently only one (I have actually switched to LOCAL in order to continue my developments, and it works), but I'm planning to use JMS in a near future, and will have to manage JMS in the same GLOBAL transaction. This is the reason why I want to be able to run it with JTA.

      Comment


      • #4
        Originally posted by gpitteloud View Post
        Currently only one (I have actually switched to LOCAL in order to continue my developments, and it works), but I'm planning to use JMS in a near future, and will have to manage JMS in the same GLOBAL transaction. This is the reason why I want to be able to run it with JTA.
        I've got your point! But sorry no help for you! I've never work with JTA. I'm using more then one datasource but no need to mix both datasource in the sabe transaction.

        Comment

        Working...
        X