openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: persistence.xml properties defined
Date Fri, 21 May 2010 13:02:42 GMT
Albert's point is that you should be using the openjpa prefix like this...

-Dopenjpa.ConnectionDriverName=org.hsqldb.jdbc.JDBCDriver
-Dopenjpa.ConnectionURL=jdbc:hsqldb:file:/tmp/persist_bacend
-Dopenjpa.DynamicEnhancementAgent=false
-Dopenjpa.RuntimeUnenhancedClasses=unsupported

Kevin

On Fri, May 21, 2010 at 7:47 AM, Web developer <webautomator2@gmail.com>wrote:

> I am passing that parameters threw JVM arguments:
>
> -DConnectionDriverName=org.hsqldb.jdbc.JDBCDriver
> -DConnectionURL=jdbc:hsqldb:file:/tmp/persist_bacend
> -DDynamicEnhancementAgent=false -DRuntimeUnenhancedClasses=unsupported
>
> 2010/5/20 Albert Lee <allee8285@gmail.com>
>
> > Shouldn't you be using "openjpa." prefix for the property names?  e.g.
> > openjpa.ConnectionDriverName=.....
> >
> > Albert Lee.
> >
> > On Mon, May 17, 2010 at 10:20 AM, Web developer <webautomator2@gmail.com
> > >wrote:
> >
> > > Here what I use:
> > >
> > > EntityManagerFactory emf =
> > > Persistence.createEntityManagerFactory("embeddables",
> > > System.getProperties());
> > >        EntityManager em = emf.createEntityManager();
> > >        init(em);
> > >        runQueries(em);
> > >
> > > runner arguments:
> > >
> > > -DConnectionDriverName=org.hsqldb.jdbc.JDBCDriver
> > > -DConnectionURL=jdbc:hsqldb:file:/tmp/persist_bacend
> > > -DDynamicEnhancementAgent=false -DRuntimeUnenhancedClasses=unsupported
> > >
> > > My persistence.xml:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> > >    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > >    version="1.0">
> > >
> > >    <persistence-unit name="hellojpa" transaction-type="RESOURCE_LOCAL">
> > >        <!--
> > >            The default provider can be OpenJPA, or some other product.
> > >            This element is optional if OpenJPA is the only JPA provider
> > >            in the current classloading environment, but can be
> specified
> > >            in cases where there are multiple JPA implementations
> > available.
> > >        -->
> > >        <!--
> > >        <provider>
> > >            org.apache.openjpa.persistence.PersistenceProviderImpl
> > >        </provider>
> > >        -->
> > >
> > >        <!-- We must enumerate each entity in the persistence unit -->
> > >        <class>hellojpa.Message</class>
> > >
> > >        <properties>
> > >            <!--
> > >                We can configure the default OpenJPA properties here.
> They
> > >                happen to be commented out here since the provided
> > examples
> > >                all specify the values via System properties.
> > >
> > >            <property name="openjpa.DynamicEnhancementAgent"
> > value="false"/>
> > >
> > >            <property name="openjpa.RuntimeUnenhancedClasses"
> > > value="unsupported"/>
> > >            -->
> > >
> > >            <property name="openjpa.Sequence"
> > > value="org.apache.openjpa.jdbc.kernel.ClassTableJDBCSeq"/>
> > >        </properties>
> > >    </persistence-unit>
> > >
> > >    <persistence-unit name="embeddables"
> > transaction-type="RESOURCE_LOCAL">
> > >
> > >
> >
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> > >        <class>Address</class>
> > >        <class>ContactInfo</class>
> > >        <class>Phone</class>
> > >        <class>User</class>
> > >    </persistence-unit>
> > > </persistence>
> > >
> > > John
> > >
> > > 2010/5/17 Jeremy Bauer <techhusky@gmail.com>
> > >
> > > > John,
> > > >
> > > > Do you specify the persistence unit name when you create the entity
> > > manager
> > > > factory?  If not, you may be picking up the default persistence unit
> > > which
> > > > likely has those properties defined.  If you do specify the PU name
> > could
> > > > you post your persistence.xml and the version of OpenJPA you are
> using?
> > > >
> > > > -Jeremy
> > > >
> > > > On Sat, May 15, 2010 at 2:35 AM, Web developer <
> > webautomator2@gmail.com
> > > > >wrote:
> > > >
> > > > > Hi. My persistence.xml contained ConnectionDriverName and
> > ConnectionURL
> > > > > properties defined for the unit that was not in use. But even when
> I
> > > > added
> > > > > tags into config for another unit - the effect is the same. John
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Albert Lee.
> >
>

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