A method for optimizing a transaction consisting of an initial sequence of
computer operations, the method including identifying one or more
idempotent operations in the initial sequence. The method further
includes reordering the initial sequence to form a reordered sequence
consisting of a first sub-sequence of the computer operations followed by
a second sub-sequence of the computer operations. The second sub-sequence
has only the one or more idempotent operations.