HibernateTransactionManager in Spring
February 09, 2013
HibernateTransactionManager handles transaction manager in Spring. HibernateTransactionManager belongs to the package org.springframework.orm.hibernate3. The application that uses single hibernate session factory for database transaction, has good choice to use HibernateTransactionManager. HibernateTransactionManager can work with plain JDBC too. HibernateTransactionManager allows bulk update and bulk insert and ensures data integrity.
HibernateTransactionManager is configured in application.xml as below.
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="configLocation" ><value>hibernate.cfg.xml</value></property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean>