openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: OpenJPA Questions
Date Sun, 17 Oct 2010 16:05:56 GMT
On Sun, Oct 17, 2010 at 2:02 AM, brian.fed7 <brian.fed7@gmail.com> wrote:

>
> Thank you Michael for all the timely help.
>
>
> Michael Dick wrote:
> >
> > Looks like we're inspecting the existing schema information. Seems like a
> > lot of calls, but I haven't run with DB2 in a while. Which version and
> > platform of DB2 are you using?
> >
> I am using DB2 v9.5.0.808
>

Windows, Linux or Unix? The SQL matches what we'd use for DB2 on one of
those OSes, we use different SQL for DB2 on z/os or i/os though.

How many EntityManagers and EntityManagerFactories does your application
create?


> Michael Dick wrote:
> >
> > Correct. There are some preconditions, like the entities need to be in
> one
> > of the JPA supported locations in the application, but in general your
> > entities will be enhanced by the container automatically.
> >
> I did not understand when you say "There are some preconditions, like the
> entities need to be in one
> of the JPA supported locations in the application". Could you please
> articulate?


The container will look for entities in certain locations in an EAR. The
details can be found in section 8.2 of the JPA 2.0 specification, here's a
quick cut and paste of the highlights:

A persistence unit may be packaged within one or more jar files contained
within a WAR or EAR, as a
set of classes within an EJB-JAR file or in the WAR classes directory, or as
a combination of these
as defined below.
A persistence unit is defined by a persistence.xml file. The jar file or
directory whose
META-INF directory contains the persistence.xml file is termed the root of
the persistence unit.
In Java EE environments, the root of a persistence unit must be one of the
following:
• an EJB-JAR file
• the WEB-INF/classes directory of a WAR file[80]
• a jar file in the WEB-INF/lib directory of a WAR file
• a jar file in the EAR library directory
• an application client jar file

If you've packaged the entity classes in some other location the container
might not enhance them for you. The results may vary from application server
to application server - I'm not sure offhand what the rules are for WAS v7
though.

I just wanted to mention it in case you happened to package the entities in
a different location.

 Michael Dick wrote:
> >
> > Nit: WAS 7.0.x actually includes OpenJPA 1.2.x. Not a big deal, but it
> > might
> > save some confusion down the road
> >
> I did not understand when you say "Not a big deal, but it might
> save some confusion down the road". Could you please articulate?


WebSphere version 7.0 (without the JPA 2.0 Feature Pack) includes OpenJPA
version 1.2. It doesn't include OpenJPA version 1.0. There are a couple of
interesting differences between OpenJPA 1.0, and 1.2 (for example SQL
statement batching).

It sounds like you want to use JPA 2.0 though, so this isn't an issue for
you. Just trying to save some confusion down the road if you went with a
'vanilla' WebSphere v7.0 install.


>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/OpenJPA-IBM-WAS-Some-basic-questions-tp5640165p5643780.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

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