• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock question about EntityManager

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In the demo of Enthuware Mock for SCBCD5, I found this:

"Session beans that use container managed EntityManager cannot use bean managed transactions."

For me it's true but Enthuware says in its explanation:
"Transaction management type of a session bean and type of entity manager (container managed or bean managed) are two different things. Any type of entity manager can be enlisted in a transaction started by a session bean with bean managed transactions."

So... Can a Container Managed EntityManager be used with BMT Session Bean?
If yes, when does it join the UserTransaction ?

Thanks in advance.

Beno�t
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally, I think that the Container Managed Entity Manager never joins the UserTransaction.

The specs (5.6.1) says:
"If the entity manager is invoked outside the scope of a transaction, any entities loaded from the database will immediately become detached at the end of the method call."

Your opinion ???
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Container managed persistence context is alway associated with the JTA transactions, which is always using CMT.

Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic