Show TOC

BackgroundConcurrency Control

 

Each service in the enterprise services packages constitutes an atomic transaction. That is, a single service call always transfers the global data in the database from one consistent state to another.

However, though the database state is always consistent, it may still become semantically incorrect if multiple service consumers are interacting concurrently on a pair of services for retrieving or modifying a piece of data respectively.

Example Example

Overwrite Strategy Leading to Incorrect Database Content

This graphic is explained in the accompanying text.

Two consumer applications A and B are about to independently post the receipt of a delivery of screws. After querying the current quantity of screws in the warehouse, they calculate the new quantity of screws based on the current quantity and the delivery size. Subsequently they write the result in the sequence A-B.

If no precautions are taken, the new value in the database will be the amount calculated by application B, as B was the last one to write the value. Though there is no consistency problem, the value in the database is still not the right value from a business point of view.

End of the example.

To avoid such problems due to the interleaved execution of corresponding data retrieval and data modification Web services, it is necessary to implement adequate prevention strategies.

Basically, there are three different conciliation strategies which may be appropriate depending on the business semantics of the set of data in question. These are: