ICommittable
Description
- Derived from
Base interface for classes that operate on an in-memory data model which is backed by a storage layer and provide data consistency via atomic commits.
When a method of a ICommittable object throws an IOException, the object may go into a failure state from which it may recover by an explicit call to Revert. Calling IFlushable.Flush will perform an implicit commit before the flush.
Public / Methods
Commit
Commits all pending modifications as an atomic operation.
If the storage layer is based on a IFile, this method will call IFile.Commit passing false.
- IOException
-
If an I/O error has occurred.
Revert
Restores the internal state of this object from the storage layer.
When this method returns without throwing, the in-memory data model and the storage layer will be synchronized and NeedsRevert will return false.
- IOException
-
If an I/O error has occurred.
Public / Attributes
NeedsRevert
Returns whether the in-memory data model and the storage layer are no longer synchronized, because of a recent I/O error.
While this property returns true, any attempt to further access or modify the data model of this object may result in an IOException being thrown. To recover from this state, the Revert method must be called.