You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Web developer <we...@gmail.com> on 2010/05/15 09:35:33 UTC

persistence.xml properties defined

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

Re: persistence.xml properties defined

Posted by Pinaki Poddar <pp...@apache.org>.
Post in user forum -- not in developer forum.
 

-----
Pinaki 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/persistence-xml-properties-defined-tp5058473p5084392.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Re: persistence.xml properties defined

Posted by Web developer <we...@gmail.com>.
And what does it change? The same thing:

396  embeddables  INFO   [main] openjpa.Runtime - Starting OpenJPA
2.0.0-beta3
733  embeddables  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.HSQLDictionary".
Exception in thread "main" <openjpa-2.0.0-beta3-r422266:926797 fatal store
error> org.apache.openjpa.persistence.RollbackException: user lacks
privilege or object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE
FROM OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501, state=42501]
at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:573)
at Main.init(Main.java:55)
at Main.main(Main.java:10)
Caused by: <openjpa-2.0.0-beta3-r422266:926797 fatal general error>
org.apache.openjpa.persistence.PersistenceException: user lacks privilege or
object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE FROM
OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501, state=42501]
at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4827)
at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4787)
at
org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:318)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:110)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62)
at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:66)
at org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
at
org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:786)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:770)
at
org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
at
org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:605)
at
org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2952)
at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:40)
at
org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1047)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2060)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2020)
at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1938)
at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1462)
at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:924)
at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:556)
... 2 more
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: user lacks
privilege or object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE
FROM OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501, state=42501]
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:237)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(LoggingConnectionDecorator.java:70)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:289)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:186)
at
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement(ConfiguringConnectionDecorator.java:155)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:175)
at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:549)
at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:529)
at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:518)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.prepareStatement(TableJDBCSeq.java:806)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.getSequence(TableJDBCSeq.java:545)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.setSequence(TableJDBCSeq.java:587)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq$AllocateSequenceRunnable.run(TableJDBCSeq.java:892)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:454)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:305)
at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
... 20 more

John

2010/5/21 Kevin Sutter <kw...@gmail.com>

> 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 <al...@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 <te...@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.
> > >
> >
>

Re: persistence.xml properties defined

Posted by Kevin Sutter <kw...@gmail.com>.
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 <we...@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 <al...@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 <te...@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.
> >
>

Re: persistence.xml properties defined

Posted by Web developer <we...@gmail.com>.
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 <al...@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 <te...@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.
>

Re: persistence.xml properties defined

Posted by Albert Lee <al...@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 <we...@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 <te...@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.

Re: persistence.xml properties defined

Posted by Web developer <we...@gmail.com>.
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 <te...@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
> >
>

Re: persistence.xml properties defined

Posted by Jeremy Bauer <te...@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 <we...@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
>