0 Replies Latest reply: Feb 28, 2012 9:34 AM by tom harel RSS

Configuring the persistence-unit provider

tom harel Newbie

Hi,

 

What would be the correct way to Configuring the persistence-unit provider and other hibernate properties ?

 

I have started working with the test cases you provided and am now working on incorporating Cassandra as the database.

I am trying to use OSG as the jbos component that will connect the Cassandra database with the hibernate FW.

OSG examples explain that the fallowing change is needed in the persistence.xml , however persistence.xml is not used in your examples and it not clear to me where the needed changes should be made.

 

<!-- when using a relational database -->

<persistence ...>

    <persistence-unit name="users" transaction-type="RESOURCE_LOCAL">

        <properties>

            <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>

            <property name="javax.persistence.jdbc.user" value="sa"/>

            <property name="javax.persistence.jdbc.password" value=""/>

            <property name="javax.persistence.jdbc.url" value="jdbc:h2:tcp://localhost/./intro-ogm"/>

            <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>

            <property name="hibernate.hbm2ddl.auto" value="update"/>

            <property name="hibernate.max_fetch_depth" value="3"/>

        </properties>

    </persistence-unit>

</persistence>

 

<!-- when using Hibernate OGM -->

<persistence ...>

    <persistence-unit name="users" transaction-type="RESOURCE_LOCAL">

        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>

        <properties>

            <property name="hibernate.ogm.infinispan.configuration_resourcename"

                      value="META-INF/ispn-config.xml"/>

        </properties>

    </persistence-unit>

</persistence>

 

 

 

For farther explanation on the OSG integration see :

  http://www.infoq.com/news/2011/07/hibernateogm