Table of Contents

Class PostgreSqlSelectForUpdateLockHandler

Namespace
Quartz.Impl.AdoJobStore
Assembly
Quartz.dll

PostgreSQL-specific row lock handler that uses INSERT ... ON CONFLICT DO NOTHING to handle race conditions when multiple threads try to insert the same lock row.

public class PostgreSqlSelectForUpdateLockHandler : SelectForUpdateLockHandler, ILockHandler
Inheritance
PostgreSqlSelectForUpdateLockHandler
Implements
Inherited Members

Remarks

This implementation fixes the transaction abort issue that occurs in PostgreSQL when two threads simultaneously attempt to insert a lock row, causing a primary key violation that aborts the transaction.

Constructors

PostgreSqlSelectForUpdateLockHandler(IDbProvider)

Initializes a new instance of the PostgreSqlSelectForUpdateLockHandler class.

public PostgreSqlSelectForUpdateLockHandler(IDbProvider dbProvider)

Parameters

dbProvider IDbProvider

PostgreSqlSelectForUpdateLockHandler(string, string, string?, IDbProvider)

Initializes a new instance of the PostgreSqlSelectForUpdateLockHandler class.

public PostgreSqlSelectForUpdateLockHandler(string tablePrefix, string schedulerName, string? selectWithLockSql, IDbProvider dbProvider)

Parameters

tablePrefix string

The table prefix.

schedulerName string

the scheduler name

selectWithLockSql string

The select with lock SQL.

dbProvider IDbProvider

The db provider.