EclipseLink/Release/2.1.0/JPA in OSGi

From Eclipsepedia

Jump to: navigation, search

JPA in OSGi in EclipseLink 2.1

With the introduction of the OSGi Enterprise specification that covers JPA usage in OSGi, and the founding of the Gemini JPA project (built on EclipseLink), EclipseLink has been upgraded in the 2.1 release to enable eventual migration to Gemini for JPA usage in OSGi. Most changes were internal however there has been one change that affects users of the existing EclipseLink JPA for OSGi support. In EclipseLink 2.1 a new fragment bundle org.eclipse.persistence.jpa.osgi has been introduced which contains the "pre-Gemini" OSGi support. When Gemini JPA is released, this fragment would not be required as its functionality would be superseded by Gemini.

Upgrading to EclipseLink OSGi JPA 2.1

To upgrade a pre-2.1 JPA OSGi application to 2.1 (and to ensure upward compatibility with Gemini):

  1. Add the new org.eclipse.persistence.jpa.osg to your deployed bundles.
  2. Update the javax.persistence imports to align with OSGi Enterprise specification requirements.

Examples

The OSGi JPA examples have all been upgraded for EclipseLink 2.1 with the two steps described above so you can explore these for examples of correct usage.