I have implemented DAO’s based on Link in the HibernateDAOFactory class, there is a method
protected Session getCurrentSession() {
return HibernateUtil.getSessionFactory().getCurrentSession();
}
To implement the same i have made the hibernate.cfg.xml changes as described in the below articles Here 1
HERE 2
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property><br/>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="hibernate.current_session_context_class">thread</property>
While deploying it on jboss i get the following errors
org.hibernate.TransactionException: could not register synchronization
I even set the property
<property name="hibernate.current_session_context_class">jta</property>
but i got the following error.
Caused by: org.hibernate.HibernateException: Unable to locate current JTA transaction
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:88)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574)
Am i missing something out here??
My jboss version is 4.2.3 and hibernate version is 3.3.1 and using Java 7.
Well for thread based session management I removed the
transaction.factory_classandmanager_lookup_classproperty from my hibernate.cfg.xml and it worked like a charm.But for jta based session management, I am still getting the same error.