Annotation Interface Transactional


@Target(METHOD) @Retention(RUNTIME) public @interface Transactional
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, will automatically retry 5 times (with backoff) if the method throws StaleStateException, LockAcquisitionException, GenericJDBCException, or a LockAcquisitionException wrapped in a PersistenceException, or an error that indicates a SQL Server snapshot isolation conflict
    int
     
    Class<? extends Exception>[]
    A list of exceptions to *not* rollback on.
    int
     
    boolean
     
    Class<? extends Exception>[]
    A list of exceptions to rollback on, if thrown by the transactional method.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Field Details

  • Element Details

    • readOnly

      boolean readOnly
      Default:
      false
    • autoRetry

      boolean autoRetry
      If true, will automatically retry 5 times (with backoff) if the method throws StaleStateException, LockAcquisitionException, GenericJDBCException, or a LockAcquisitionException wrapped in a PersistenceException, or an error that indicates a SQL Server snapshot isolation conflict
      Returns:
      Default:
      true
    • autoRetryCount

      int autoRetryCount
      Default:
      5
    • isolationLevel

      int isolationLevel
      Default:
      -1
    • rollbackOn

      Class<? extends 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

      Class<? extends 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:
      {}