R
Rizwan
I work on stateless session EJBs which are using Container-managed
Transactions. My Inserts, Updates and Deletes are inside an EJB method. I
never call any commit/rollback.
Now i am starting to use DAO pattern. So Inserts, Updates and Deletes are
available as DAO methods. Now the EJB calls the DAO methods to do this kind
of stuff. The DAOs are not doing any commit/rollback. My question is will
the Container-managed Transactions be extended to the DAOs automatically.
For example I have 3 updates as part of one transaction. These 3 updates are
available in 3 different DAOs. If any one of them fail I want to rollback
the whole transaction. Before when these 3 updates are inside EJB, I was
safe because of Container-managed Transactions. But now they are outside of
EJB and I dont know if this functionality will be available.
If container do keep track of transactions like that then how many nested
levels I can go on? In one particular scenario, my EJB calls a method in a
class which in turn calls DAOs for Inserts/Updates/Deletes. Will they be
part of Container-managed Transactions as well?
Thanks
Rizwan
Transactions. My Inserts, Updates and Deletes are inside an EJB method. I
never call any commit/rollback.
Now i am starting to use DAO pattern. So Inserts, Updates and Deletes are
available as DAO methods. Now the EJB calls the DAO methods to do this kind
of stuff. The DAOs are not doing any commit/rollback. My question is will
the Container-managed Transactions be extended to the DAOs automatically.
For example I have 3 updates as part of one transaction. These 3 updates are
available in 3 different DAOs. If any one of them fail I want to rollback
the whole transaction. Before when these 3 updates are inside EJB, I was
safe because of Container-managed Transactions. But now they are outside of
EJB and I dont know if this functionality will be available.
If container do keep track of transactions like that then how many nested
levels I can go on? In one particular scenario, my EJB calls a method in a
class which in turn calls DAOs for Inserts/Updates/Deletes. Will they be
part of Container-managed Transactions as well?
Thanks
Rizwan