A stateful session bean needs to restore its conversational state to its initial state if the transaction
in which the bean is participating rolls back.
Which bean method can be used to do this?
A.
SessionContext.setRollbackOnly
B.
SessionContext.getUserTransaction
C.
SessionSynchronization.afterCompletion
D.
SessionSynchrinization.beforeCompletion
Explanation:
The afterCompletion method notifies a stateful session bean instance that a
transaction commit protocol has completed, and tells the instance whether the transaction has
been committed or rolled back.
Returns:
True if the current transaction is marked for rollback, false otherwise.
Reference: javax.ejb, Interface SessionSynchronization