Expand my Community achievements bar.

[JTATransaction] You should set hibernate.transaction.manager_lookup_class if cache is enabled

Avatar

Former Community Member

Hello

I keep seeing the above error in my server log. My model file has the following. What is the warning about and how to rectify it in the right way

thanks

Rupak

<annotation name="DMS">

    <item name="datasource">java:comp/env/ALGODB</item>

    <item name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</item>

    <item name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JOTMTransactionManagerLookup</item>

    <item name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</item>

    <item name="ServerGeneratedEntities">false</item>

  </annotation>

3 Replies

Avatar

Former Community Member

Rupak,

Your configuration seems to be correct. Can you post your Hibernate config file and server log?

Regards,

Ashish Vashisht

Avatar

Former Community Member

Hi Ashish

There is nothing else in log other than the following. Where do I find hibernate configuration file. There is none in my project folder and the only place hibernate is being configured is in the .fml file that also I pasted..

: You should set hibernate.transaction.manager_lookup_class if cache is enabled

thanks

Rupak

Avatar

Former Community Member

Hi

Sorry for the delay in replying, I was out of office for the last week or so.

Can you check your Data Source configuration, specifically if it has the factory property specified or not?

    <Transaction factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>    
    <Resource name="jdbc/ordersDB" type="javax.sql.DataSource"
          driverClassName="org.hsqldb.jdbcDriver"
          maxIdle="2" maxWait="5000"
          factory="org.objectweb.jndi.DataSourceFactory"
          url="jdbc:hsqldb:hsql://localhost:9002/ordersdb" username="sa" password="" maxActive="4"
    />

If that does not help, can you enable trace level logging on org.hibernate.jdbc.* and org.hibernate.transaction.* That should help identify the cause of the issue.

Regards,

Ashish Vashisht