Hibernate / EclipseLink Interview questions
What is a Persistence Unit in EclipseLink?
A persistence unit is a named configuration grouping a set of entity classes together with the database connection and provider settings needed to manage them. It's declared inside persistence.xml and is the boundary an EntityManagerFactory is built from.
A single application can define multiple persistence units, each pointing at a different database or a different subset of entities, which is common in systems that need to talk to more than one data source. Each unit specifies its provider (EclipseLink, in this case), its transaction type (JTA or RESOURCE_LOCAL), and any provider-specific properties like caching or logging settings.
More Related questions...