Interface FailSafeTransaction

  • All Known Implementing Classes:
    FailSafeTransactionImpl

    public interface FailSafeTransaction
    A failsafe transaction interface. By failsafe we mean here that the file concerned always stays in a coherent state.
    Author:
    Benoit Pradelle
    • Method Detail

      • restoreFile

        void restoreFile()
                  throws IllegalStateException,
                         IOException
        Ensure that the file accessed is in a coherent state. This function is useful to do a failsafe read without starting a transaction.
        Throws:
        IllegalStateException - if the file doesn't exists anymore
        IOException - if an IOException occurs during the file restoration
      • beginTransaction

        void beginTransaction()
                       throws IllegalStateException,
                              IOException
        Begins a new transaction. If a transaction is already active, commits the changes and begin a new transaction. A transaction can be closed by a commit or rollback operation. When the transaction begins, the file is restored to a coherent state if needed.
        Throws:
        IllegalStateException - if the file doesn't exists anymore
        IOException - if an IOException occurs during the transaction creation