Interface MCRPersistenceTransaction

All Known Implementing Classes:
MCREntityTransaction, MCROCFLPersistenceTransaction

public interface MCRPersistenceTransaction
Thread safety: Implementation must not ensure that concurrent access is without side effects.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Start a transaction.
    void
    Commit the current transaction, writing any unflushed changes to the backend.
    boolean
    Determine whether the current transaction has been marked for rollback.
    boolean
    Indicate whether a transaction is in progress.
    boolean
    preconditions in the backend are met and this instance should be used for transactions
    void
    Roll back the current transaction.
  • Method Details

    • isReady

      boolean isReady()
      preconditions in the backend are met and this instance should be used for transactions
      Returns:
      true if this instance is ready for transaction handling, e.g. underlaying database is configured
    • begin

      void begin()
      Start a transaction.
      Throws:
      IllegalStateException - if isActive() is true
    • commit

      void commit()
      Commit the current transaction, writing any unflushed changes to the backend.
      Throws:
      IllegalStateException - if isActive() is false
    • rollback

      void rollback()
      Roll back the current transaction.
      Throws:
      IllegalStateException - if isActive() is false
    • getRollbackOnly

      boolean getRollbackOnly()
      Determine whether the current transaction has been marked for rollback.
      Returns:
      boolean indicating whether the transaction has been marked for rollback
      Throws:
      IllegalStateException - if isActive() is false
    • isActive

      boolean isActive()
      Indicate whether a transaction is in progress.
      Returns:
      boolean indicating whether transaction is in progress