1 Reply Latest reply on Jul 25, 2002 12:48 AM by Sri Krishna

    Transactions - urgent

    amiPian Newbie

      How can I implement nested transaction handling in EJB?

      Our application server is based on stateless session beans.

      We have one EJB that need nested transaction handling -
      when the EJB calls another one, it will define a sub-transaction.
      if the second EJB fails, it will do rollback only to itself.
      if it succeed, but the parent transaction fails, it rollbacks itself and all the sub-transactions.

      thanks a lot

        • 1. Re: Transactions - urgent
          Sri Krishna Newbie

          EJB spec does not mandate support for nested transactions and JBoss I don't think supports nested transactions (I am not completely sure if it does).

          However you can have one transaction at any time by suspending and resuming transactions. In this case you can't achieve the case where if the parent fails it would roll back the inner tx. However if you in a tx you make call to other beans that do not start tx but participate in the tx then if the global tx rolls back then all participants would rollback.