Optimistic Concurrency

from Wikipedia, the free encyclopedia

Optimistic Concurrency (also known as: Optimistic Locking ) is a procedure, for example in merchandise management systems, to regulate the parallel access of several users to the same data record with little conflict and without inconsistencies .

With the Optimistic Concurrency several users are granted parallel access. This means that all users generally have read rights to e.g. B. call up or print item information. However, if an article has been changed by one of the users, other users who try to change the same data record almost simultaneously receive a notification that the article has been updated. In this case, the user who changed the data record first is privileged . If the user leaves the data record, his privilege is withdrawn again and the next user is given write access.

In contrast, with pessimistic concurrency ( pessimistic locking ), when a user accesses the data record, read and write access is blocked for all other users. It is therefore no longer possible for other users to call up or print out a data record until the data record is released again.

The pessimistic concurrency assumes that a data record should be changed with (almost) every access. The optimistic concurrency, on the other hand, is based on the premise that data records are primarily opened for read access.

The Optimistic Concurrency minimizes access conflicts during operation, since only simultaneous access for changes leads to a conflict, while simultaneous read access does not.

See also

Timestamp procedure

swell

Web links