We have part of the system in Spring and part of the system is non Spring based. Now we are deprecating all the calls using hibernate template to session.getCurrentSession. Also we are using the same session factory in both Spring and non Spring based system. For the Hibernate transaction management to be bound to single thread, we have to put the following property
<property name="current_session_context_class">thread</property>
However Spring does not likes it and for the Spring to work properly, it recommends removing he above property. It gives the exception that their is no active transaction. Check this
If we remove it, then non Spring based system complains that we cannot use getCurrentSession as we have not configured the current_session_context_class property.
Right now we are making session factory using Spring as follows:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
...
</bean>
Any idea or thought around this. Thanks in advance.