Interface Transaction

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractTransaction

public interface Transaction extends AutoCloseable
Author:
Vince Bickers
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
    static enum 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    If this transaction can be committed
    default boolean
    If this transaction can be rolled back.
    void
    close this transaction.
    void
    commit a transaction that has pending writes
    boolean
    Obtains the read-only status of a transaction.
    void
    rollback a transaction that has pending writes
    return the status of the current transaction
    Returns type of the transaction - READ_ONLY / READ_WRITE The value corresponds to type returned by isReadOnly()
  • Method Details

    • rollback

      void rollback()
      rollback a transaction that has pending writes
    • commit

      void commit()
      commit a transaction that has pending writes
    • canCommit

      boolean canCommit()
      If this transaction can be committed
      Returns:
      true if this transaction can be committed
    • canRollback

      default boolean canRollback()
      If this transaction can be rolled back.
      Returns:
      true if this transaction can be rolled back
    • status

      return the status of the current transaction
      Returns:
      the Status value associated with the current transaction
    • isReadOnly

      boolean isReadOnly()
      Obtains the read-only status of a transaction. Transaction are read-write by default
      Returns:
      true if this is a read-only transaction, false otherwise
    • type

      Returns type of the transaction - READ_ONLY / READ_WRITE The value corresponds to type returned by isReadOnly()
      Returns:
      type of the transaction
    • close

      void close()
      close this transaction.
      Specified by:
      close in interface AutoCloseable