Hi all,
I am very much confused with transaction at service/application layer and transaction at DAO layer.
My question is What is the purpose of a transaction at a service layer?
Lets say for Example. I have shopping cart where the requirement says on successful payment of fee
1) the order information Should be sent to the shipping sector
2)Removing an item from the cart
3)Sending an email to the customer who ordered it
The basic principle is to put all the three under a single transaction. SO either all commits or rollbacks. but what confuses me is
Where to start this transaction, Should i start this transaction at Service layer in session beans or at the dao layer with entity beans?
With
EJB, If i start my transaction at the service layer containing session beans, this can be propagated to entity beans so either all commits are roll backs, if some failure occurs
but what happens if i integrate my application with Hibernate instead of entity beans for persistence,Now I am aware that hibernate transaction should be used for
persistence instead of EJB transaction.
my question is in this scenario what is the purpose of starting a transaction in session bean when we use hibernate transaction.
Thanks,
Shyam.