Patent ID: 7499955

Claim:
A computer-implemented method for undoing a transaction, the method comprising: creating a DO transaction for an operation, wherein creating a DO transaction for the operation includes a computer processor: associating a DUO chain with the DO transaction, wherein the DUO chain indicates a sequence of operations of the DO transaction, logging UNDO atoms to the DUO chain, wherein the UNDO atoms indicate prior memory states for operations of the DO transaction, and determining whether an exception is encountered during the DO transaction, and performing only a memory swap operation on the DO transaction when an exception is encountered, wherein the memory swap operation includes returning to the prior memory state indicated by the logged UNDO atoms of the DUO chain; committing the DO transaction for the operation when the exception is not encountered, wherein committing the DO transaction for the operation includes the computer processor: executing the sequence of operations of the DO transaction, clearing the UNDO atoms from the DUO chain, and associating the DUO chain with a stack; and creating an UNDO transaction, wherein the UNDO transaction includes: accessing the DUO chain associated with the stack, walking the DUO chain in reverse order, wherein walking the DUO chain in reverse order includes by calling a method to cause an inverse action to execute to negate an action of the DO transaction, logging INVERSE UNDO atoms to the DUO chain, wherein the INVERSE UNDO atoms indicate a prior memory state for operations of the UNDO transaction, only if an exception is encountered during the walking of the DUO chain, performing a memory swap operation, wherein the memory swap operation includes returning to a prior memory state indicated by the logged INVERSE UNDO atoms of the DUO chain, else, continuing the walking of the DUO chain in reverse order until the UNDO transaction is complete.