Interface Batch

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
ContextualBatch
All Known Implementing Classes:
AbstractContextualBatch, DefaultTransactionalBatch, SimpleContextualBatch

public interface Batch extends AutoCloseable
Instruments the batching of cache operations. Write-only cache operations invoked while this batch is active (i.e. not suspended) will defer invocation until close(). Calling discard() will cause close() to undo previous write operations and discard any accumulated write-only operations (similar to setRollbackOnly() semantics).
Author:
Paul Ferraro
  • Field Details

  • Method Details

    • getStatus

      Batch.Status getStatus()
    • suspend

      SuspendedBatch suspend()
      Suspends this batch.
      Returns:
      a suspended batch
    • suspendWithContext

      default Context<SuspendedBatch> suspendWithContext()
      Suspends this batch until Context.close().
      Returns:
      a suspended batch context
    • discard

      void discard()
      Discards this batch. A discarded batch must still be closed.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable