Container-managed Transactions scope



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


.



Relevant Pages

  • Re: Container-managed Transactions scope
    ... Updates and Deletes are inside an EJB method. ... > the Container-managed Transactions be extended to the DAOs automatically. ... > If container do keep track of transactions like that then how many nested ...
    (comp.lang.java.programmer)
  • Re: Container-managed Transactions scope
    ... Updates and Deletes are inside an EJB method. ... Now i am starting to use DAO pattern. ... safe because of Container-managed Transactions. ...
    (comp.lang.java.programmer)
  • Re: j2ee architecture advice needed
    ... MySQL tables are not transactional. ... transactions. ... You might want to look at the upcomming EJB 2.1 Web Services, ... > utilize stateless session beans, ...
    (comp.lang.java.programmer)
  • Re: Is there a BEA Tuxedo equivalence in Java?
    ... >> that scales well and handles hi volume transactions. ... I think you need EJB. ... A lot depends on the type of messaging you need. ... I think web services are pretty neat but there is a lot of overhead. ...
    (comp.object)
  • Re: Newbie question about db normalization theory: redundant keys OK?
    ... It's my understanding, from reading in here, that "time varying relation" ... transactions, let alone future transactions. ... The "container" terminology makes for a nice distinction between container ...
    (comp.databases.theory)