November 2003
Intermediate to advanced
1488 pages
36h 35m
English
In this section, we discuss the best practices for choosing the appropriate transaction attributes. The recommended choice for a transaction attribute is Required because it ensures that the methods of an enterprise bean are invoked under a JTA transaction. These EJBs can be made to perform work under the scope of a single transaction.
If an enterprise bean method needs to commit its results unconditionally, the RequiresNew transaction attribute is the right choice. That attribute always creates a new transaction, regardless of whether another transaction is in progress—an example is logging. The appropriate method in the EJB that performs logging should be invoked with the RequiresNew attribute. ...
Read now
Unlock full access