2 Replies Latest reply on May 7, 2008 3:22 AM by Tom Baeyens

    ejb exceptions

    Tom Baeyens Master

      Hi Alejandro,

      I saw you changed the runtime exceptions into EJBExceptions in the enterprise beans. Can elaborate a bit why so that I also understand it :-)

      (i also noticed that you removed the setRollbackOnly. that i can understand as the CMT will rollback when a runtime transaction is thrown)

      but the CMT should also rollback when a pvm exception is thrown cause that is a runtime exception, no ?

        • 1. Re: ejb exceptions
          Alejandro Guizar Master

          Tom,

          These changes are the result of my reading section 18.2.2 "System Exceptions" of the EJB 2.1 spec, which encourages the bean provider to (1) propagate an unchecked exception to the container and (2) wrap an unrecoverable checked exception into an EJBException.

          The container catches any unchecked exception, rolls back the transaction and throws an EJBException to the (local) client - not the original exception.

          Throwing a PvmException will also roll back the transaction, but the container will still wrap it into an EJBException, so why bother.

          • 2. Re: ejb exceptions
            Tom Baeyens Master

            ah ok.

            makes sense.

            we could think of a PvmEjbException (extends EJBException), but i don't see the need for that. you ?