Can you please paste the error you receive?

I'm not sure how to override it, will have a look now. Though, what
are you trying to achieve with this? Maybe there is another way to get
the same thing. I assume you're just trying to use a different
provider for tests than you do for production?

Quintin Beukes



On Fri, Oct 23, 2009 at 7:50 AM, hypnosat7 <abla...@yahoo.fr> wrote:
>
> Hello,
>
> If I set the provider property in the persistence.xml of my EJB project in
> works. But if I set the provider via system properties (to override the
> persistence.xml) my tests fail and the reason is that the data are not
> stored to the database.
>
> So this is my persistence.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0"
>    xmlns="http://java.sun.com/xml/ns/persistence";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";>
>    <persistence-unit name="educaPU">
>        <!--
>        <provider>org.hibernate.ejb.HibernatePersistence</provider>
>         -->
>        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>        <jta-data-source>java:/OracleDS</jta-data-source>
>        <properties>
>            <property name="hibernate.hbm2ddl.auto" value="update" />
>            <property name="hibernate.dialect"
> value="org.hibernate.dialect.Oracle10gDialect" />
>            <!--
>                MySQL <property name="hibernate.hbm2ddl.auto"
> value="create-drop" />
>                <property name="hibernate.dialect"
>                value="org.hibernate.dialect.MySQLInnoDBDialect" />
>            -->
>        </properties>
>    </persistence-unit>
> </persistence>
>
> I've add the line:
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> because using the
> "-Djavax.persistence.provider=org.eclipse.persistence.jpa.PersistenceProvider"
> as VM arguments make my tests failing.
>
> Thanks for any help.
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/Override-Porvider-property-via-system-properties-tp26021215p26021215.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>

Reply via email to