container managed transaction demarcation in EJB

Discussions

EJB programming & troubleshooting: container managed transaction demarcation in EJB

  1. hi, I have problems getting container managed transactions working.
    i am trying to post 1 transaction. the transaction has two business methods. both methods are ejbCreate method. I want to rollback first method if second method fails. but when I do that, only second method fails. I read from paper that application exceptions like createException, RemoveException don't rollback in container transaction demarcation.
    how i can do that both methods rollback.
  2. how about setting the rollbackonly flag ... ?
    i.e catch these createException ot remove exception and set the rollbackonly flag .
    I think that should work ...

    let me know
    mohan
  3. i have already set rollbackOnly flag in RemoteException, but it does not work.
  4. do not catch CreateException, it is a System Exception and will indicate to the container failure of the transaction, hense trigerring the rollback., use setRollbackOnly(), only if the rollback needs to be based on a business decision.
  5. I am also facing the same problem. I am using Iplanet App server. Transactions work fine in business methods, but cause problems while using create methods.

    I have tried calling setRollbackOnly(), but does not work.
    Let me know anybody has any solution.