Hello
I'm trying to configure OGM with Infinispan + JPA loader.
Here is my persistents.xml :
Code:
<?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"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="DB" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>db.generated.PackageEntity</class>
<properties >
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@10.1.5.81:1521:LDS"/>
<property name="javax.persistence.jdbc.user" value="***" />
<property name="javax.persistence.jdbc.password" value="****" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.NoJtaPlatform"/>
</properties>
</persistence-unit>
<persistence-unit name="IMDG" transaction-type="RESOURCE_LOCAL" >
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<property name="hibernate.ogm.datastore.provider" value="infinispan"/>
<property name="hibernate.ogm.infinispan.configuration_resourcename" value="infinispan.xml"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.NoJtaPlatform"/>
</properties>
</persistence-unit>
</persistence>
Here is the infinispan.xml
Code:
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
xmlns="urn:infinispan:config:5.1">
<global>
</global>
<default>
</default>
<namedCache name="ENTITIES">
<loaders preload="true" passivation="false" shared="true" >
<loader class="org.infinispan.loaders.jpa.JpaCacheStore" fetchPersistentState="true" purgeOnStartup="false" ignoreModifications="true" >
<properties>
<property name="persistenceUnitName" value="DB" />
<property name="entityClassName" value="db.generated.PackageEntity" />
</properties>
</loader>
</loaders>
</namedCache>
<namedCache name="ASSOCIATIONS">
</namedCache>
<namedCache name="IDENTIFIERS">
</namedCache>
</infinispan>
I'm gettting StackOverflowError when I booststrap JPA :
Code:
Persistence.createEntityManagerFactory("IMDG")
As you can see initiator calls itself in endless loop :
My environment :
Code:
dependencies {
compile 'org.slf4j:slf4j-log4j12:1.7.5',
'org.hibernate:hibernate-core:4.2.7.SP1',
'org.hibernate:hibernate-entitymanager:4.2.7.SP1',
'org.hibernate.ogm:hibernate-ogm-infinispan:4.0.0.Beta4',
'org.hibernate.ogm:hibernate-ogm-core:4.0.0.Beta4',
'org.hibernate:hibernate-jpamodelgen:1.3.0.Final',
'org.infinispan:infinispan-core:5.3.0.Final',
'org.infinispan:infinispan-cachestore-jpa:5.3.0.Final'
}
Please advice
Thanks
Alexander