@Inherited @InterceptorBinding @Retention(value=RUNTIME) @Target(value={TYPE,METHOD}) public @interface Compensatable
The org.jboss.narayana.compensations.api.Compensatable annotation provides the application the ability to declaratively control compensation transaction boundaries on CDI managed beans, as well as classes defined as managed beans by the Java EE specification, at both the class and method level where method level annotations override those at the class level.
This support is provided via an implementation of CDI interceptors that conduct the necessary suspending, resuming, etc. The Compensatable interceptor interposes on business method invocations only and not on lifecycle events. Lifecycle methods are invoked in an unspecified transaction context.
The TxType element of the annotation indicates whether a bean method is to be executed within a transaction context. TxType.REQUIRED is the default.
By default checked exceptions do not result in the transactional interceptor marking the transaction for rollback and instances of RuntimeException and its subclasses do. This default behavior can be modified by specifying exceptions that result in the interceptor marking the transaction for rollback and/or exceptions that do not result in rollback.
Modifier and Type | Optional Element and Description |
---|---|
Class[] |
cancelOn
The cancelOn element can be set to indicate exceptions that must cause
the interceptor to mark the transaction for compensation.
|
boolean |
distributed
The distributed element states whether a distributed or local transaction should be begun,
under circumstances where this annotation causes a new transaction to begin.
|
Class[] |
dontCancelOn
The dontCancelOn element can be set to indicate exceptions that must not cause
the interceptor to mark the transaction for compensation.
|
CompensationTransactionType |
value |
public abstract CompensationTransactionType value
public abstract Class[] cancelOn
public abstract Class[] dontCancelOn
Copyright © 2021 JBoss by Red Hat. All rights reserved.