This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Contradiction about em.getTranaction() in the spec !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Contradiction about em.getTranaction() in the spec !!" Watch "Contradiction about em.getTranaction() in the spec !!" New topic
Author

Contradiction about em.getTranaction() in the spec !!

Aditya Vasudeva
Ranch Hand

Joined: May 27, 2008
Posts: 76
I found a contradiction in the spec. (well, I think it is...)

Page 47 of the spec (ejb-persistence) describes that a getTransaction() of the EntityManager returns a resource-level transaction object.
At the bottom of the same page it again says that getTransaction() is used to manage application-managed entity mangers.

Isn't this a contradiction because application-managed entity managers use JTA which is different from resource-level entity managers ???
E Lievaart
Greenhorn

Joined: Jul 06, 2008
Posts: 28
That would be container managed;
The UserTransaction interface is unavailable to enterprise beans with container-managed transaction demarcation. (p. 81)
Aditya Vasudeva
Ranch Hand

Joined: May 27, 2008
Posts: 76
I could'nt get your point........
Vinay Nath
Ranch Hand

Joined: Jul 06, 2008
Posts: 85
An application managed entity manager can be either involved in the JTA transaction or through the EntityTransaction API (a resource-local entity manager).

when you manage an entity (thru application) in container it always use JTA but outside container it uses resource local.

So it can have both.


SCDJWS 5.0, SCBCD 5.0, SCWCD 5.0, SCJP 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Contradiction about em.getTranaction() in the spec !!
 
Similar Threads
Entity Managers - Types
A question form Sun's Free Proficiency Assessment System
Application Managed???
EntityManager.joinTransaction() only for application-managed EntityManagers?
application managed EM can be either JTA or resource-local?