Interface Transaction

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
RecordContextTransaction, RecordStoreAndRecordContextTransaction

public interface Transaction extends AutoCloseable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    boolean
     
    default <T> T
    unwrap(Class<? extends T> type)
    Unwraps this instance as type T, if such a cast is possible.
  • Method Details

    • commit

      void commit() throws com.apple.foundationdb.relational.api.exceptions.RelationalException
      Throws:
      com.apple.foundationdb.relational.api.exceptions.RelationalException
    • abort

      void abort() throws com.apple.foundationdb.relational.api.exceptions.RelationalException
      Throws:
      com.apple.foundationdb.relational.api.exceptions.RelationalException
    • close

      void close() throws com.apple.foundationdb.relational.api.exceptions.RelationalException
      Specified by:
      close in interface AutoCloseable
      Throws:
      com.apple.foundationdb.relational.api.exceptions.RelationalException
    • isClosed

      boolean isClosed()
    • unwrap

      @Nonnull default <T> T unwrap(@Nonnull Class<? extends T> type) throws com.apple.foundationdb.relational.api.exceptions.InternalErrorException
      Unwraps this instance as type T, if such a cast is possible. This provides a convenient API for unwrapping implementation calls from the interface (to avoid lots of instanceof checks everywhere).
      Type Parameters:
      T - the generic type
      Parameters:
      type - the type to unwrap it as.
      Returns:
      this instance, as an instanceof Type T
      Throws:
      com.apple.foundationdb.relational.api.exceptions.InternalErrorException - if instance types are incompatible