Incase of DAO s extended by HibernateDAOSupport classes, I tried transcations to work with annotation based declaration:
-defined transaction in confg.xml
eg
<!-- enable the configuration of transactional behavior based on annotations -->
<tx:annotation-driven transaction-manager="txManager"/>
<!-- The PlatformTransactionManager for Hibernate-->
<bean id="txManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
<property name="sessionFactory">
<ref bean="daoservice.SessionFactory" />
</property>
</bean>
-annotate the method with: @Transactional(propagation=Propagation.REQUIRES_NE W)
For testing I throwed NullPointerException within DAO method
Eg :
String test = null;
if(test.length() >1){
log.error("Throwing error");
}
Transcation was not rolled back even after exception...
does hibernateDAOSupport classes support enclosing Transction as stated above.


Reply With Quote
