Hi,
I'm trying to setup neo4j and hibernate ogm on jboss 7. This is my persistence.xml configuration:
Code:
<?xml version="1.0"?>
<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="ogm-jpa-tutorial" transaction-type="JTA">
<!-- Use Hibernate OGM provider: configuration will be transparent -->
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>
<property name="hibernate.ogm.datastore.provider" value="neo4j_embedded"/>
<property name="hibernate.ogm.neo4j.database.path" value="E:\Development\neo4j\crud"/>
<property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4"/>
<property name="jboss.as.jpa.providerModule" value="org.hibernate:ogm"/>
<property name="jboss.as.jpa.classtransformer" value="false"/>
<property name="hibernate.listeners.envers.autoRegister" value="false"/>
</properties>
</persistence-unit>
</persistence>
And my EJB responsible for saving entity:
Code:
@TransactionManagement(TransactionManagementType.CONTAINER)
public class CrudBean {
@PersistenceContext(unitName="ogm-jpa-tutorial")
private EntityManager em;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void persistAction() {
Breed b = new Breed();
b.setName("TEST");
em.persist(b);
}
}
I'm still getting error: org.neo4j.graphdb.NotInTransactionException
Could anyone help me please?