[1] Compensating transaction logic could be implemented as additional on top of database supporting commit/rollback.
Typically, this is only a workaround which has to be implemented manually and cannot guarantee that the system always ends in a consistent state.
In such cases, data will be committed to permanent storage, but may subsequently need to be rolled back, perhaps due to the user opting to cancel the operation.
Unlike conventional rollbacks, specific business logic will typically be required to roll back a long lived transaction and restore the system to its original state.
Compensating transactions are often designed into Web services that participate in the execution of business processes that are part of a service-oriented architecture solution.