tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Saint Croix" <>
Subject Alternatives to specifying persistence provider in component jars?
Date Thu, 13 Dec 2007 03:29:43 GMT

I'm working on an application that at the moment includes a single
(proof-of-concept) entity bean in my main web application WAR, and also
large number of entity beans which are JAR'd in the WEB-INF/lib.

Knowing that the persistence management is all outboard and not contained
inside of OpenEJB, perhaps you guys could help me with a matter of
configuration anyway.

I wonder whether there is any way for me to NOT include the <provider> and
<properties> elements defining the persistence provider implementation,
connection URL, connection driver name, username and password in the
persistence.xml file for my entity/POJO jar (the one inside of WEB-INF/lib),
but rather configure that specific portion of the persistence.xml file
inside of the context of the application that is using these beans?  It
doesn't seem to be any of the POJO JAR's business what type of persistence
provider is being used to persist its contents.

I've attached an example of the <provider> and <properties> elements I wish
to exclude below.  I want to define classes but not persistence provider
information in the entity JARs, and define the persistence provider for
these persistence-units once at the container level.  Is this possible, and
if so, how might I accomplish that separation with OpenEJB?

Alexander R. Saint Croix

<persistence xmlns="" version="1.0">
    <persistence-unit name="example" transaction-type="RESOURCE_LOCAL">


            <property name="openjpa.jdbc.SynchronizeMappings"

            <property name="openjpa.ConnectionURL"

            <property name="openjpa.ConnectionDriverName"

            <property name="openjpa.ConnectionUserName"

            <property name="openjpa.ConnectionPassword"

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