Hi all,
I read the Spring 1.2.4 reference (PDF) and in page 125 it says :
What does it mean by 'automatically participate in transactions' ?...
HibernateTemplate will ensure that sessions are properly opened and closed, and
automatically participate in transactions
...
Are the following statements true regarding the above phrase ?
a. When my apps use HibernateTemplate I don't need the following statement :
b. When my apps use HibernateTemplate I don't need the following declaration :Code:... Transaction trans = session.beginTransactions(); try { ... trans.commit(); { catch (Exception e) { ... trans.rollback(); } ...
c. What if I run my applications on EJB environment, do I still need the above code & transaction declaration even if I already use HibernateTemplate ?Code:... <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean name="classUnderTransaction" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="txManager"/> <property name="target" ref="classUnderTransactionTarget"/> ... </bean> ...
Any clarifications would be greatly appreciated.
Regards,
Setya


Reply With Quote