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")
Please have a look at forum question : https://forum.hibernate.org/viewtopic.php?f=31&t=1029990&sid=99edcb329914d3c83859f391cadef097
|