Hi,
Does Slice support using a connection pool? I was able to get the
connection pool working when not using Slice with the following
persistence-unit:
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<properties>
<property name="openjpa.ConnectionProperties"
value="DriverClassName=com.mysql.jdbc.Driver,
Url=jdbc:mysql://url:3306/test,
MaxActive=300,
TestOnBorrow=true,
Username=user,
Password=password"/>
<property name="openjpa.ConnectionDriverName"
value="org.apache.commons.dbcp.BasicDataSource"/>
</properties>
</persistence-unit>
However, I got an error when attempting to use it in Slice, with the
following:
<persistence-unit name="test2" transaction-type="RESOURCE_LOCAL">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<properties>
<property name="openjpa.Log" value="Runtime=TRACE, SQL=TRACE,
DefaultLevel=TRACE, Tool=TRACE"/>
<property name="openjpa.BrokerFactory" value="slice"/>
<property name="openjpa.slice.Names" value="slice1"/>
<property name="openjpa.slice.Master" value="slice1"/>
<!-- Lenient: Allows DB to continue, even when one slice is unavailable.
-->
<property name="openjpa.slice.Lenient" value="true"/>
<property name="openjpa.ConnectionDriverName"
value="org.apache.commons.dbcp.BasicDataSource"/>
<property name="openjpa.slice.slice1.ConnectionProperties"
value="DriverClassName=com.mysql.jdbc.Driver,
Url=jdbc:mysql://url:3306/test,
MaxActive=300,
TestOnBorrow=true,
Username=user,
Password=password"/>
<property name="openjpa.slice.DistributionPolicy"
value="com.....service.openjpa.DistributeByInstitutionPolicy"/>
<property name="openjpa.slice.FinderTargetPolicy"
value="com.....service.openjpa.ShardFinderTargetPolicy"/>
<property name="openjpa.slice.ReplicatedTypes"
value="com...."/>
. <property name="openjpa.QueryCache" value="false"/>
<property name="openjpa.DataCache" value="false"/>
. <property name="openjpa.QueryCompilationCache" value="false"/>
<property name="openjpa.jdbc.QuerySQLCache" value="false"/>
<property name="openjpa.jdbc.FinderCache" value="false"/>
<property name="openjpa.DetachState"
value="loaded(DetachedStateField=false)"/>
</properties>
</persistence-unit>
Am I missing something in my configuration or is this just something that is
not supported by Slice? If it's not supported, are there any recommended
alternatives?
Thanks,
Richard.