openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "brian.fed7" <>
Subject Re: JPA & OpenJPA Best Practices & Performance Tips
Date Tue, 05 Oct 2010 04:58:06 GMT

First of all thank you for such a detailed response.

Ours is not an existing application that we are refactoring for adding
enhancements but a development-from-scratch application and we are using all
IBM tools like IBM Rational Application Developer (RAD) IDE, IBM DB2, IBM
WebSphere Application Server (WAS) v7.0

Kevin Sutter wrote:
> o  Ensure that you are using OpenJPA's entity class enhancement
> processing.
> Either at build time, or at run time.  Do not rely on the subclassing
> support that can be the "fall back" process for monitoring entity usage.
> Using the entity class enhancement processing [1]  will ensure the best
> performing and most functional experience with OpenJPA.
I think if we are using IBM WAS v7.0 then we do not need to worry about JPA
class enhancement because it was told here
that IBM WAS will automatically take care of Entities enhancement at
runtime. Please correct me if my understanding is wrong.

Kevin Sutter wrote:
> o  You don't mention what level of OpenJPA you are looking to use.  I
> would
> suggest either OpenJPA 2.0.x or 2.1.x [5].  Both of these service streams
> support the latest JPA 2.0 specification, along with many other
> performance
> and functional improvements over the previous releases.
Since ours is development application we have the luxury of using latest
stable OpenJPA v2.1.x binary

Kevin Sutter wrote:
> o  Is your database schema fixed (due to past releases) or is it flexible?
> If it's fixed, then I would suggest creating the Entity templates from the
> defined database schema using reverse mapping [6].  This will give you a
> very good start on the Entities required to interact with your database.
> You can always tweak them as necessary to add additional data logic, but
> the
> meat of the code is done.
If I understand your point correctly, I think we can use JPA wizards inside
RAD IDE that can automatically generate Java Entities from an existing
database rather than manually creating/modifying Java Entities if there is a
change in Database Entities and we do not need to use OpenJPA's reverse
mapping utilities
Please correct me if my understanding is wrong.

Kevin Sutter wrote:
> o  And, concerning your comment about using the DB2 IDENTITY COLUMN.  This
> is what you would get if you use
> @GeneratedValue(strategy=GenerationType.IDENTITY) with a DB2 database as
> your configured datasource.  GenerationType.SEQUENCE also uses database
> facilities for the Sequence processing.  A bit more information can be
> found
> here [7].
This link
does not say which one is 
better for performance reasons and based on my application requirements. I
@GeneratedValue(strategy=GenerationType.IDENTITY) are better than any other
sequence generation strategies for our application requirements. Any
thoughts on this point?

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

View raw message