openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <>
Subject Re: JPA & OpenJPA Best Practices & Performance Tips
Date Tue, 05 Oct 2010 18:36:02 GMT
More information for you to chew on...  :-)

On Tue, Oct 5, 2010 at 12:17 PM, brian.fed7 <> wrote:

> Kevin Sutter wrote:
> >
> > Correct.  If you are using JPA within WebSphere and using
> > container-managed
> > persistence (another "best practice"), then your entities will
> > automatically
> > get enhanced as they are loaded into the Container environment.  This is
> > the
> > case for both the EJB and Web Container scenarios.
> >
> Below are the steps I have done for using OpenJPA in our Ear/Web
> Application
> deployed on IBM RAD/WAS v7.0:
> a. I have downloaded the latest OpenJPA 2.0.1 jars and created a java
> utility project(say for example, my-commons) inside RAD and placed the
> OpenJPA jars inside my-commons\lib
> 2. declared all my Entities in persistence.xml
> 3. use JPA annotations for all my Entities
> With the above mentioned steps, I assume that IBM WAS will automatically
> enhance my Entities and I do not need to do anything extra. Is my
> understanding correct? Also, as you said I am not using any
> container-managed persistence.  or am I missing any configuration or funda
> for leveraging JPA/OpenJPA entity classes enhancement (for performance
> reasons) inside IBM RAD and its WAS v7.0 test environment? Could you please
> clarify ?

Hmmm...  If this works for you, I would be surprised.  Unless all
interaction with OpenJPA is done in application-managed mode.  And, thus,
you would not be able to take advantage of the container automatically
enhancing your Entities.  Here's why...

WAS v7 is a Java EE 5 compliant application server.  It knows about the JPA
1.0 specification, APIs, and implementations.  Although JPA 2 is binary
compatible with JPA 1 from an application runtime perspective, it does
require some new XSD and API updates.  These are packaged as part of the
WebSphere runtime in the plugins directory as OSGi bundles.  Without some
type of "covert action", WAS v7 only knows about JPA 1.0.

Thus, the need for the JPA 2.0 Feature Pack (your later question)...  With
the OSGi and JPA 2.0 Feature Pack, the WAS v7 environment is upgraded to
recognize the XSD's and API's needed for the JPA 2.0 programming model.  Of
course, WAS continues to support JPA 1.0, but it also can now support JPA

> Kevin Sutter wrote:
> >
> > Excellent.  As an FYI, the OpenJPA 2.0.x service stream ships with the
> > WebSphere OSGi/JPA 2.0 Feature Pack that sits on top of WAS v7.0.  As a
> > WAS
> > v7 customer, this FeP is available for a free download, in case you are
> > interested.  More information can be found here:
> >
> >
> >
> I will start looking at the URL you gave above but please excuse me for my
> curiosity and if I am jumping into questions too early. We are using IBM
> and IBM WAS v7.0 test environment inside IBM RAD and I suppose we already
> have OpenJPA in IBM WAS v7.0 test environment when we installed IBM RAD and
> its WAS v7.0 test environment. If my understanding is correct then why do
> we
> need this "WebSphere Application Server V7 Feature Pack for OSGi
> Applications and Java Persistence API 2.0"?

I think I answered this above.  If you decide to try out the OSGi and JPA
2.0 FeP, then you should also move to the RAD v8 tooling.  This is fully
supported with WAS v7 and it also provides the necessary tooling for OSGi
and JPA 2.0.

Good luck,

>  --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message