|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
@Inherited
public @interface TransactionalMarks a method or class to be executed within a transaction.
This will span a new transaction around the method unless there is already a running transaction. In the case that there is a running transaction no new transaction is started. If a rollback happens for a method which did not start the transaction the already existing transaction will be marked as rollbackOnly. Guice uses AOP to enhance a method annotated with@Transactional with a wrapper.
This means the @Transactional only works as expected when:
Provider) injected into your class
or by calling Injector.getInstance(Class) or Injector.getInstance(Key).
| Optional Element Summary | |
|---|---|
Class<? extends Exception>[] |
ignore
A list of exceptions to not rollback on. |
Class<? extends Annotation>[] |
onUnits
A List of annotations for persistence units on which to start a transaction. |
Class<? extends Exception>[] |
rollbackOn
A list of exceptions to rollback on. |
public abstract Class<? extends Annotation>[] onUnits
public abstract Class<? extends Exception>[] rollbackOn
RuntimeException.
public abstract Class<? extends Exception>[] ignore
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||