wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Differences between Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Differences between "Container Managed" Entity Manager and  "Application Managed" one" Watch "Differences between "Container Managed" Entity Manager and  "Application Managed" one" New topic
Author

Differences between "Container Managed" Entity Manager and "Application Managed" one

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Thank you for reading my post.

What are differences between "Container Managed" Entity Manager and "Application Managed" one?



When we are talking in context of EJB 3.0 and JPA.

Thanks
Debu Panda
author
Ranch Hand

Joined: Jan 21, 2007
Posts: 100
As the name suggests, lifecycle of container-managed entity manager is managed by the container and you can use @PersistenceContext to inject an instance of EntityManager. However it's developer's responsibility is to manage the lifecycle of entity manager e.g. create an instance from entity manager factory, associate with a transaction and close it when you are done. Sorry for doing a plug for my book, we discuss this in Chapter 9 of the book!


Author: EJB 3 In Action (http://manning.com/panda)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Differences between "Container Managed" Entity Manager and "Application Managed" one
 
Similar Threads
Can I say an entity manager injected into session bean must be container managed?
EntityManager types in JPA
Using Application Managed Entity Manager for Bean with CMT
Persistence Context Question
Difference between container managed entity manager & CMT