• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be container managed;
The UserTransaction interface is unavailable to enterprise beans with container-managed transaction demarcation. (p. 81)
 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could'nt get your point........
 
Vinay Nath
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!