Just to be sure, I modified the spring config file and added
<tx:annotation-driven />
<bean id=”transactionManager”
class=”org.springframework.orm.hibernate3.HibernateTransactionManager”>
<property name=”sessionFactory” ref=”sessionFactory” />
</bean>
Since I had chosen to use Annotations while doing the exercise, I had to add
@Transactional annotations to the class and methods of the DTO to get things working.
But adding the annotation and the above config changes were not enough.
I had to
1) convert DTO and entities to use interface
2) replace the BeanFactory to use ApplicationContext.