[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Partitioning with Spring managed data sources
|
Your code seems like it should work.
The error,
Missing partitioning policy for name [Replicate].
means you did not define a partition policy named 'Replicate'. You need to
define this.
Include the code where you define and use this.
Mike Key-3 wrote:
>
> Hello,
>
> I am wondering if partitioning with Spring managed data sources is
> supported with Eclipselink 2.3.2? It seems to work ok, and I'm not sure
> if
> the error I see is related to the fact the data sources are spring managed
> or if the direct error is more about something else I may be doing wrong.
>
> I have things all wired in spring using the EclipselinkJpaVendorAdapter
> and
> I set all of my persistence.xml properties in the spring context through
> that adapter as follows:
>
> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close"
> p:driverClassName="org.hsqldb.jdbcDriver"
> p:url="jdbc:hsqldb:mem:target:/db/default;hsqldb.applog=1"
> p:username="sa"/>
>
> <bean id="nevadaDataSource"
> class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close"
> p:driverClassName="org.hsqldb.jdbcDriver"
> p:url="jdbc:hsqldb:mem:target:/db/nevada;hsqldb.applog=1"
> p:username="sa"/>
>
> <bean name="eclipseLinkPersistenceProvider"
> class="org.eclipse.persistence.jpa.PersistenceProvider">
> </bean>
>
> <bean id="pum"
>
> class="com.betfair.myproject.spring.extension.MergingPersistenceUnitManager">
> <property name="persistenceXmlLocations">
> <list>
> <value>classpath*:META-INF/persistence.xml</value>
> </list>
> </property>
> <property name="defaultDataSource" ref="dataSource"/>
> </bean>
>
> <bean id="entityManagerFactory"
>
> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
> <property name="persistenceUnitName" value="sample"/>
> <property name="dataSource" ref="dataSource"/>
> <property name="persistenceUnitManager" ref="pum"/>
> <property name="persistenceProvider"
> ref="eclipseLinkPersistenceProvider"/>
> <property name="jpaVendorAdapter">
> <bean
>
> class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
> <property name="databasePlatform"
>
> value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
> <property name="showSql" value="true"/>
> <property name="generateDdl" value="true"/>
> </bean>
> </property>
> <property name="jpaPropertyMap">
> <map>
> <entry key="eclipselink.logging.level" value="FINE"/>
> <entry
> key="eclipselink.connection-pool.default.nonJtaDataSource"
> value="dataSource"/>
> <entry
> key="eclipselink.connection-pool.nevada.nonJtaDataSource"
> value="nevadaDataSource"/>
> <entry key="eclipselink.partitioning"
> value="Replicate"/>
> </map>
> </property>
>
> </bean>
>
> I have my classes defined as normal in the persistence.xml as appropriate.
> One class I have setup with RoundRobinPartitioning. When I run a unit
> test I get the following exception from Eclipselink:
>
> Caused by: Exception [EclipseLink-220] (Eclipse Persistence Services -
> 2.3.2.v20111125-r10461):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: Missing partitioning policy for name [Replicate].
> at
> org.eclipse.persistence.exceptions.DescriptorException.missingPartitioningPolicy(DescriptorException.java:2051)
> at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updatePartitioning(EntityManagerSetupImpl.java:683)
> at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateSession(EntityManagerSetupImpl.java:1949)
> at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:471)
> ... 88 more
>
> Again this is not pointing directly to the fact I am using spring managed
> data sources, but I am starting to suspect that is actually the issue.
>
> Any assistance is greatly appreciated.
>
>
>
-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.eclipse.org/forums/index.php?t=thread&frm_id=111&S=1b00bfd151289b297688823a00683aca
EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
Blog: http://java-persistence-performance.blogspot.com/ Java Persistence
Performance
--
View this message in context: http://old.nabble.com/Partitioning-with-Spring-managed-data-sources-tp33332600p33379402.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.