Multiple choice technology databases

Which transaction attribute should be set in the deployment descriptor for a method to guarantee that the method is NOT invoked with a transaction?

  1. RequiresNew

  2. Supported

  3. Never

  4. Mandatory

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The 'Never' transaction attribute in EJB deployment descriptors ensures that a method will never be invoked within an existing transaction context. If called within a transaction, the container throws an exception. 'RequiresNew' always creates a new transaction, 'Supported' runs within existing transaction if present, and 'Mandatory' requires an existing transaction to be present (throws exception if none exists).