architect-handbook

Software Architect Handbook

View on GitHub

Pessimistic Offline Lock

Prevents conflicts between concurrency business transactions by allowing only one business transaction at a time to access data.

Overview

Pessimistic Offline Lock prevents conflicts by avoiding them altogether. It forces a business transaction to acquire a lock on a piece of data before it starts to use it, so that, most of the time, once you begin a business transaction you can be pretty sure you’ll complete it without being bounced by concurrency control.

How It Works

Lock Types

In choosing the correct lock type think about maximizing system concurrency, meeting business needs, and minimizing code complexity. Also keep in mind that the locking strategy must be understood by domain modelers and analysts.

When to Use It