posted 19 years ago
Hi,
IN HFE, it's said that in case of system exceptions , the container will always rollback the transaction, and throw either a RemoteExceptionn (remote view) or EJBException (local view). cf p.534
However, in the spec, there's a distinction to be made between rollback the transaction and mark the transaction for rollback.
This distinctin may concern first CMT vs BMT demarcation.
By example, for Message Driven Bean table 17 spec p.377 we can see that the container's action concsists in rollback the container-started transaction whereas the container's action consists in mark for rollback the transaction that has been started in case of BMT.
This distinction between rollback and only mark for rollback may have an impact also in the kind of exceptions thrown by the container.
Indeed, in the case of session or entity bean's business methods running in the context of the caller's transaction (table 15 p.375 spec) the container only marks the transaction for rollback and also throw javax.transaction.TransactionRolledbackException to Remote Clients and throws javax.ejb.TransactionRolledbackLocalException to Local Clients.
But in the case of session or entity bean's business methods running in the context of a transactio that the Container started immediately before dispatching the business method (this may happen with Required and RequiresNew attributes), the Container rollbacks the container-started transaction (table 15 p.375 spec) and throw RemoteException to remote clients and EJBException to local clients.
That's just for more complete information...
Regards,
Cyril.
[ November 12, 2004: Message edited by: cyril vidal ]