Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2009
    Posts
    16
    Rep Power
    0

    Default CMT setRollbackOnly(), RollabackException

    [P-189] of EJB3 In Action: "In case of transactions propagated from the client, if our method indicates that the transaction should be rolled back, the container
    will not only roll back the whole transaction but will also throw a javax.transaction.RollbackException back to the client."

    a) I tested this scenario, the container is not throwing RollbackException.Moreover nothing of this sort is written in EJB3 specs.
    b) When will contianer rollback the transaction?? Here 2 cases can occur:
    case i) When this method is NOT called from transactional client.. In this case the container mark the transaction to be rolledback (at the
    statement where exception occurs) and will actully rollback transaction at method end.
    case ii) When this method is called from transactional client. Suppose a BMT started a UserTransaction and called a CMT method,
    In this case this CMT method will join the callers transaction. Now will the container simply marks the transaction to be rolledback and
    the BMT method should check this flag and then only either rollback or commit the transaction ??
    Last edited by CatchSandeepVaid; 11-01-2009 at 01:56 PM.

Similar Threads

  1. setRollbackOnly problem
    By jack239 in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 08-07-2008, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •