Some time ago I held a presentation about "BPEL and transactions". I will take the important parts of that and publish it here. I split it into several parts. This ist part 1.
General considerations
A transaction is a logical unit consisting of one or many operations.
The 4 ACID properties of transactions are: Atomacy, Consistency, Isolation and Durability.
Usually, during the processing of a transactions some components of a systems are locked to avoid inconsistencies.
Try-Cancel-Confirm mechanism
One possible solution is the Try-Cancel-Confirm mechanism.
TRY: the call of reservation service
PENDING: the system reserves the resource for a specific time
CONFIRM: when all operations were succesfull, the reservation is being confirmed
CANCEL: if an error occured during execution, every change is being canceled
Disadvantage: The Locking of the resource (reservation) is only possible for a short amount of time
TRY, CONFIRM and CANCEL operations must be provided by the called service.
Solution in BPEL: Compensation
- methods to reverse the changes being done so far
- often the execution of the inverse operation (or rollback) is not enough
- "logical UNDO" = method, which executes a functional, complete reversal/cancelation
- for example a cancelation of an order in a remote system, sending of an correction e-mail,...
- the reversal method must be provided by the service
Compensation pattern
To be continued...
Keine Kommentare:
Kommentar veröffentlichen