Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Container-Manager EntityManager - Automatically joins JTA ?

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In application-managed EntityManager, we explicitly call entityManager.joinTransaction().
In container-manager Entitymanager does it automaticalls joins JTA ?
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a container managed EntityManager (i.e. injected, or JNDI looked up) should automatically be JTA managed.

In some servers you may need to set your JPA provider to be integrated with the server in the persistence.xml for this to function.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!