File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes PersistenceContect and EntityManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "PersistenceContect and EntityManager" Watch "PersistenceContect and EntityManager" New topic

PersistenceContect and EntityManager

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10031

What is the difference between these two? I"m in a great confusion!

Man we need a Head First EJB 3.

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
What is the difference between these two?
Do you need it for SCBCD ? In this case I would suggest reading the corresponding part in PRO EJB 3 or in the ejb 3.0 spec (persistence pdf), because the topic is really too complicated to be described in detail here. And a brief explanation like "a persistence context is some sort of a cache for entities" would probably not suffice for SCBCD.

SCJP 5 (98%) - SCBCD 5 (98%)
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 404
JPA Spec 5.1

A persistence context is a set of managed entity instances in which for any persistent entity identity there is a unique entity instance. Within the persistence context, the entity instances and their lifecycle are managed by the entity manager.
I agree. Here's the link:
subject: PersistenceContect and EntityManager
It's not a secret anymore!