However, in an Web services scenario, transactions may also takea long time to complete. For this case, WS-Transaction uses thenotion of business activity and defines a protocol based oncompensation (as opposed to locking) used to achievedistributed consensus on whether the results of a long-runningmessage exchange should be made persistent.

This standard defines the port types (WSDL interfaces) thatmust be implemented by each participant service depending onits role in the transaction (e.g., initiator, outcome listener). Italso specifies the port types provided by the coordinator.

The actual implementation of the operations corresponding to acommit, abort or compensate message are left unspecified asthey are highly dependent on the business logic of the specificWeb service.

Similar to traditional ACID transactions

Services enroll transaction-aware resources

Databases

Message queues

Completion Initiator

Application

Signals coordinator to complete a transaction

Can request commit or rollback

Coordinator

Responsible for coordinating a single outcome

Drives 2PC with participants

Phase 1: Ensure all participants are prepared

Phase 2: Notify participants of outcome

Participants

can vote to abort

Can vote “prepared to commit”

Must honor coordinator’s commit decision

Short running atomic transactions can be part of a longrunning business transaction

The actions of the embedded atomic transactions arecommitted and made visible before the long runningbusiness transaction completes

In the event of the long running business transactionfailing, the effects of such atomic transactions need to becompensated for.

The business activity model has multiple protocols:

BusinessAgreement

BusinessAgreementWithComplete

Unlike the AT protocol, which is driven from thecoordinator down to participants, this protocol is drivenfrom the participants upwards.