Status: Accepted (in force). Reconstructed from implementation.

Context

Two payroll preparations for the same company at once would corrupt the shared temp/live state. Runs are also large and long — a way is needed to (a) prevent concurrency and (b) let C# poll for completion.

Decision

A per-company control row, PayrollMonitor, acts as a lock:

Consequences

Good:

Bad / costs:

Alternatives considered