Package org.seedstack.seed.transaction
Annotation Type Transactional
-
@Target({METHOD,TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Inherited public @interface Transactional
Transaction method marker. If a method is marked with this annotation, transaction manager logic will be invoked around the method.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class<? extends Exception>[]noRollbackForA list of exceptions to not rollback on.Propagation[]propagationSpecify the transaction propagation type needed for the marked element.boolean[]readOnlyDefine the transaction as having a read-only behavior.Class<? extends Exception>[]rollbackOnA list of exceptions to rollback on, if thrown by the transactional method.boolean[]rollbackOnParticipationFailureDefine if a failure by a participating transaction should mark the surrounding transaction as rollback only.
-
-
-
Element Detail
-
propagation
Propagation[] propagation
Specify the transaction propagation type needed for the marked element.- Returns:
- the propagation type.
- Default:
- {}
-
-
-
readOnly
boolean[] readOnly
Define the transaction as having a read-only behavior. It is used as an hint to the transaction manager to optimize its behavior. Note that it is not required for the transaction manager to enforce strict read-only behavior.- Returns:
- true if read-only false otherwise.
- Default:
- {}
-
-
-
noRollbackFor
Class<? extends Exception>[] noRollbackFor
A list of exceptions to not rollback on. A caveat to the rollbackOn clause. The disjunction of rollbackOn and noRollbackFor represents the list of exceptions that will trigger a rollback. The complement of rollbackOn and the universal set plus any exceptions in the ignore set represents the list of exceptions that will trigger a commit. Note that ignore exceptions take precedence over rollbackOn, but with subtype granularity.- Returns:
- the list of exception classes to NOT rollback for.
- Default:
- {}
-
-