Module jakarta.ejb
Package jakarta.ejb

Annotation Interface AfterBegin


@Target(METHOD) @Retention(RUNTIME) public @interface AfterBegin
Designate a stateful session bean method to receive the after begin session synchronization callback.

The after begin callback notifies a stateful session bean instance that a new transaction has started and that the subsequent business methods on the instance will be invoked in the context of the transaction.

This method executes in the proper transaction context. A bean must have at most one AfterBegin method. The signature of this method must observe the following rules:

  • The method must not be declared as final or static.
  • The method may have any access type.
  • The return type must be void.
  • The method must take no arguments.

A stateful session bean class may use either the SessionSynchronization interface or the session synchronization annotations, but not both.

Since:
EJB 3.1
See Also: