-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Neo4j on JBoss
PostPosted: Wed Dec 11, 2013 9:04 am 
Newbie

Joined: Wed Dec 11, 2013 8:59 am
Posts: 1
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?


Top
 Profile  
 
 Post subject: Re: Neo4j on JBoss
PostPosted: Tue Dec 17, 2013 8:08 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
at the moment Neo4j requires a particular JtaPlatform implementation to work in OGM: org.hibernate.ogm.transaction.neo4j.impl.Neo4jJtaPlatform

While this is working for standalone application I'm not sure it is going to work inside a container.

We are aware of the issue and we are looking for a solution.
You can keep on eye on the JIRA to know when it is going to be fixed: https://hibernate.atlassian.net/browse/OGM-370

Cheers,
Davide


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.