Code:
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<list>
<value>MyRecord.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.autocommit">false</prop>
</props>
</property>
</bean>
Code:
<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="sessionFactory"><ref local="sessionFactory"/></property>
<property name="globalRollbackOnParticipationFailure" value="false" />
</bean>
<tx:advice id="tx-advice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="perform" propagation="REQUIRED" isolation="DEFAULT" rollback-for="SystemException"/>
<tx:method name="updateRecords" propagation="REQUIRED" isolation="DEFAULT" rollback-for="SystemException"/>
<tx:method name="createRecords" propagation="REQUIRED" isolation="DEFAULT" rollback-for="SystemException"/>
</tx:attributes>
</tx:advice>
Any Idea ?