I did some research(after i received comment on question) I found spring have all I needed.
Say, in BL we have method: SomeBLMethod(), which does db operation using SalesOrderDAO, SalesOrderItemDAO and SomeBLMethod should be under transaction. We need to do following to make Transaction work:
- Get the object of SalesOrderDAO, SalesOrderItemDAO implementation using spring @Autowired attribute and perform db opration using these attributes.
- Make SomeBLMethod transactional using sprint @Transactional attribute.
- The implementation of SalesOrderDAO, SalesOrderItemDAO should use @Autowired SessionFactory object
- We also need to do some spring configuration.(which you can find in following url)
Reference:
- Example: http://www.byteslounge.com/tutorials/spring-with-hibernate-persistence-and-transactions-example
- Spring Transaction Management Doc: http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/transaction.html
PS: I am adding this answer to help others.