Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
We are facing a peculiar problem with respect to Hibernate,WAS 6 and EhCache.The entire production configuration is on a 4-node WAS 6 Cluster with EhCache as the caching implementation.We have set the expiry period for query cache regions to 7 days.
After about 6 days there is WebSphere Transaction timeout while executing one of the hibernate queries...the trace given below is obtained.
It hangs the node and is propagated to the rest of the nodes resulting in the restart of the cluster.
We have not been able to figure out whether it is a WAS 6 and Hibernate integration issue or something to do with EHCache.I am giving one of the hibernate configuration xmls as a reference,please do point anomalies if any and suggest a solution for this asap.
Please feel free to ask for any kind of reference like code snippets,xmls etc for further investigation.Any help would be highly appreciated :)
Hibernate 2.1.7:
WebSphere Application Server 6.0.2.15 :
Hibernate Configuration xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- This mentions the Datasource name which is configured in the Websphere App server -->
<property name="connection.datasource">java:comp/env/jdbc/local/DS</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.InformixDialect</property>
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
</property>
<property name = "hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<property name="hibernate.jndi.class">com.ibm.websphere.naming.WsnInitialContextFactory</property>
<!-- This property mentions the url where the WAS is listening to -->
<property name="hibernate.jndi.url">iiop:///</property>
<
<!-- List all the mapping files in this section -->
<mapping resource="product.hbm.xml"/>
<!-- List the classes and usage for second level cache -->
<class-cache class="test.bo.Product" usage="read-only" />
</session-factory>
</hibernate-configuration>
:
Exception Trace
--------------------
Caused by: net.sf.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3369)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3333)
at test.dataaccess.hibernate.HibernateDAO.setIsolationLevel(HibernateDAO.java:207)
... 24 more
Caused by: javax.transaction.RollbackException: Transaction rolled back
at com.ibm.ws.Transaction.JTA.TransactionImpl.registerSynchronization(TransactionImpl.java:3431)
at com.ibm.ws.Transaction.JTA.TransactionImpl.registerSynchronization(TransactionImpl.java:3410)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3364)
... 26 more
DataBase Use : Informix 9.4:
Regards
Arjun