| Author |
Compensation Question
|
|
|
| Hi
I am having trouble working out how compensations work on atomic transactions.
I have two atomic transactions both calling sql sps each with compensation
blocks.
The send ports used to call sql have delivery notification enabled. If the
second transaction fails (violation of primary key) its compensation handler
is invoked (as well as the first transactions handler.
I thought that the compensation block should only run if a transaction is
successful?
So it is failing an insert and then deleting a record through the
compensation code.
Can someone please help?
| |
| Ramprasad 2006-01-25, 8:32 am |
| Compensation block will compensate for anything that goes wrong in an
transaction be it atomic or Long running.
"Rob" wrote:
> Hi
>
> I am having trouble working out how compensations work on atomic transactions.
> I have two atomic transactions both calling sql sps each with compensation
> blocks.
>
> The send ports used to call sql have delivery notification enabled. If the
> second transaction fails (violation of primary key) its compensation handler
> is invoked (as well as the first transactions handler.
>
> I thought that the compensation block should only run if a transaction is
> successful?
> So it is failing an insert and then deleting a record through the
> compensation code.
>
> Can someone please help?
| |
|
| No this is not the case. When a scope is marked as atomic, if the send port
fails (and has delivery notification) then the compensation handler is
invoked.
However if the scope is changed to long running then the compensation
handler is not invoked.
Why is this? Can someone please explain the different behaviour?
Thanks,
Rob
"Ramprasad" wrote:
[vbcol=seagreen]
> Compensation block will compensate for anything that goes wrong in an
> transaction be it atomic or Long running.
>
> "Rob" wrote:
>
|
|
|
|