I agree, 'good need'. Hmmm, but why implement as follows? what is default
value? why the need to 'force'?
configurable through
-Dopenejb.jpa.force.javax.persistence.provider=true|false
I am specifying my datasource(s) in tomee.xml, it references the
jta-data-source name as defined in persistence.xml. I would assume this is
sufficient to specify as many persistence providers in persistence.xml and
as many resources in tomee.xml which reference jta-data-source name's
defined in persistence.xml.
So, my tomee.xml contains the following:
<Resource id="jdbc/mcmsJta" type="javax.sql.DataSource">
JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
JdbcUrl jdbc:derby:C:/javadb/databases/mcmsdev;create=true
UserName ...
Password ...
JtaManaged true
jmxEnabled true
LogSql false
InitialSize 10
MaxActive 100
MaxIdle 30
MaxWait 10000
minIdle 10
suspectTimeout 60
removeAbandoned true
removeAbandonedTimeout 180
timeBetweenEvictionRunsMillis 30000
jdbcInterceptors=StatementCache(max=128)
</Resource>
and persistence.xml contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="mcmsPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/mcmsJta</jta-data-source>
<non-jta-data-source>jdbc/mcmsNonJta</non-jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database"
value="org.eclipse.persistence.platform.database.DerbyPlatform"/>
<property name="eclipselink.jdbc.cache-statements" value="true" />
<property name="eclipselink.jdbc.cache-statements.size" value="100"
/>
<property name="eclipselink.logging.parameters" value="false" />
</properties>
</persistence-unit>
</persistence>
On Fri, Feb 22, 2013 at 8:47 AM, Romain Manni-Bucau
<[email protected]>wrote:
> Hi,
>
> good need: https://issues.apache.org/jira/browse/TOMEE-779
>
>
> 2013/2/22 Lazar Kirchev <[email protected]>
>
> > Hello,
> >
> > I would like to set eclipselink as the default persistence provider in
> > TomEE (which is done through system properties as I read in the
> > documentation), but still want to allow the applications to use other
> > providers (e.g. hibernate).
> > Is this possible? I see in the code that if the application specifies a
> > persistence provider in its persistence.xml, this is overriden by the
> value
> > of the system property, if one is set.
> >
> > Regars,
> > Lazar
> >
>