com.wideplay.warp.persist
Annotation Type Transactional


@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
public @interface Transactional

Created with IntelliJ IDEA. On: May 26, 2007 2:54:07 PM

Any method or class marked with this annotation will be considered for transactionality. Consult the documentation on http://www.wideplay.com for detailed semantics.

Marking a method @Transactional will work with the default configuration as expected. Any classes marked @Transactional will only work if you specify the forAll(Matchers.annotatedWith(Transactional.class), Matchers.any() clause in your warp-persist module configuration.

Class level @Transactional allows you to specify transaction semantics for all non-private methods in the class once at the top. You can optionally override it on a per-method basis too. However, this means that classes not marked @Transactional but with methods marked @Transactional will *not* be intercepted for transaction wrapping.

Author:
Dhanji R. Prasanna (dhanji@gmail.com)

Optional Element Summary
 java.lang.Class<? extends java.lang.Exception>[] exceptOn
          A list of exceptions to *not* rollback on.
 java.lang.Class<? extends java.lang.Exception>[] rollbackOn
          A list of exceptions to rollback on, if thrown by the transactional method.
 TransactionType type
          This is an experimental feature and is only supported for Hibernate.
 

type

public abstract TransactionType type
This is an experimental feature and is only supported for Hibernate. It does *not* work with JPA, even if your provider is Hibernate underneath.

Returns:
Returns the configured transaction type.
Default:
READ_WRITE

rollbackOn

public abstract java.lang.Class<? extends java.lang.Exception>[] rollbackOn
A list of exceptions to rollback on, if thrown by the transactional method. These exceptions are propagated correctly after a rollback.

Returns:
Returns the configured rollback exceptions.
Default:
java.lang.RuntimeException.class

exceptOn

public abstract java.lang.Class<? extends java.lang.Exception>[] exceptOn
A list of exceptions to *not* rollback on. A caveat to the rollbackOn clause. The disjunction of rollbackOn and exceptOn represents the list of exceptions that will trigger a rollback. The complement of rollbackOn and the universal set plus any exceptions in the exceptOn set represents the list of exceptions that will trigger a commit. Note that exceptOn exceptions take precedence over rollbackOn, but with subtype granularity.

Returns:
Returns the configured rollback exceptions.
Default:
{}