Library/Patterns/Transaction

Overview
A transaction compose a complex operation as a set of sub-operations which either all succeed or none. In case of failure (permissions, network error, out of resources, user abort), the source data remains unaffected as none of sub-operations had applied.

Most programmers are familiar with the notion of transactions from source control management systems (such as git, perforce, cvs, etc.). The same notion of a "commits" and a "workspace" can apply within a program runtime as well.

Definition
A Transaction is an ordered, compound operation that applies an atomic fashion: i.e. fully succeeds or fails without side-effect.

A transaction may support rollback to invert the operations either as (1) a mechanism to undo a partially applied transaction upon detection of failure or (2) as an explicit operation to revert the effects of the transaction.

Implementation
TBD

Related

 * Atomic operations, Atomic Transaction, Changelist