Oracle GlassFish Server 3.0.1 Upgrade Guide

Applications That Use Persistence

GlassFish Server 3.0.1 and Sun GlassFish Enterprise Server v3 use the persistence provider EclipseLink, while earlier versions used TopLink Essentials.

An application that uses the container to create an EntityManager or EntityManagerFactory and that used Toplink Essentials as its provider will work in GlassFish Server 3.0.1. The container creates an EntityManager if the application uses the @PersistenceContext annotation to inject an EntityManager, as in the following example:

@PersistenceContext
EntityManager em;

The container creates an EntityManagerFactory if the application uses the @PersistenceUnit annotation to inject an EntityManagerFactory, as in the following example:

@PersistenceUnit
EntityManagerFactory emf;

EntityManager em = emf.createEntityManager();

When the application is loaded, GlassFish Server 3.0.1 will translate the provider to EclipseLink and will also translate toplink.* properties in the persistence.xml to corresponding EclipseLink properties. (The actual persistence.xml file remains unchanged.)

Under certain circumstances, however, you may have to modify the persistence.xml file or your code: