<s>
The	O
execution	O
of	O
a	O
business	O
process	O
consists	O
of	O
one	O
or	O
more	O
transactions	B-General_Concept
.	O
</s>
<s>
There	O
are	O
two	O
groups	O
of	O
systems	O
where	O
compensating	B-General_Concept
transaction	I-General_Concept
may	O
be	O
applied	O
:	O
</s>
<s>
In	O
the	O
context	O
of	O
a	O
database	O
this	O
is	O
often	O
easily	O
achieved	O
using	O
transactions	B-General_Concept
and	O
the	O
commit/rollback	O
mechanism	O
.	O
</s>
<s>
Compensating	B-General_Concept
transaction	I-General_Concept
logic	O
could	O
be	O
implemented	O
as	O
additional	O
on	O
top	O
of	O
database	O
supporting	O
commit/rollback	O
.	O
</s>
<s>
For	O
systems	O
without	O
a	O
commit/rollback	O
mechanism	O
available	O
,	O
one	O
can	O
undo	O
a	O
failed	O
transaction	O
with	O
a	O
compensating	B-General_Concept
transaction	I-General_Concept
,	O
which	O
will	O
bring	O
the	O
system	O
back	O
to	O
its	O
initial	O
state	O
.	O
</s>
<s>
The	O
system	O
designer	O
may	O
need	O
to	O
consider	O
what	O
happens	O
if	O
the	O
compensating	B-General_Concept
transaction	I-General_Concept
also	O
fails	O
.	O
</s>
<s>
Compensating	B-General_Concept
transactions	I-General_Concept
are	O
also	O
used	O
in	O
case	O
where	O
a	O
transaction	O
is	O
long	O
lived	O
(	O
commonly	O
called	O
Saga	B-General_Concept
Transactions	I-General_Concept
)	O
,	O
for	O
instance	O
in	O
a	O
business	O
process	O
requiring	O
user	O
input	O
.	O
</s>
<s>
Unlike	O
conventional	O
rollbacks	B-Application
,	O
specific	O
business	O
logic	O
will	O
typically	O
be	O
required	O
to	O
roll	O
back	O
a	O
long	O
lived	O
transaction	O
and	O
restore	O
the	O
system	O
to	O
its	O
original	O
state	O
.	O
</s>
<s>
This	O
type	O
of	O
transaction	O
differs	O
from	O
distributed	B-General_Concept
transactions	I-General_Concept
(	O
often	O
implemented	O
using	O
the	O
two-phase-commit	B-General_Concept
protocol	I-General_Concept
)	O
,	O
because	O
although	O
both	O
types	O
of	O
transactions	B-General_Concept
can	O
result	O
in	O
multiple	O
data	O
stores	O
being	O
updated	O
,	O
compensating	B-General_Concept
transactions	I-General_Concept
allows	O
for	O
the	O
updates	O
to	O
span	O
a	O
long	O
period	O
of	O
time	O
.	O
</s>
<s>
Compensating	B-General_Concept
transactions	I-General_Concept
are	O
often	O
designed	O
into	O
Web	O
services	O
that	O
participate	O
in	O
the	O
execution	O
of	O
business	O
processes	O
that	O
are	O
part	O
of	O
a	O
service-oriented	O
architecture	O
solution	O
.	O
</s>
