If the method calls from the client to the EJB are called within the context of a transaction, what will happen if the transaction is rolled back?What gets sent back to the client? There are many possible combinations of circumstances that can happen when multiple beans and multiple transactions are involved from a single client's method call. What happens if a downstream transaction is rolled back?
How does the current transaction, which will be restarted when the downstream one completes, know of or react to, the failure of the downstream transaction?
Bean-managed transactions
Because the bean has direct access to the transaction manager status using the getStatus() method of the Transaction object,
the programmer can write the code so that it can handle any eventuality and take the appropriate action. Using bean-managed transactions requires the programmer to be familiar with the in an outs of transaction programming.
Container-managed exceptions
The following table describes the possible conditions and the exceptions that are thrown when multiple bean instances are involved in one or more transactions. It is copied from the EJB1.1 specification.
View and study the table below.
In the next lesson, the three transaction management schemes will be compared.