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
dbProviderIDbProvider
PostgreSqlSelectForUpdateLockHandler(string, string, string?, IDbProvider)
Initializes a new instance of the PostgreSqlSelectForUpdateLockHandler class.
public PostgreSqlSelectForUpdateLockHandler(string tablePrefix, string schedulerName, string? selectWithLockSql, IDbProvider dbProvider)
Parameters
tablePrefixstringThe table prefix.
schedulerNamestringthe scheduler name
selectWithLockSqlstringThe select with lock SQL.
dbProviderIDbProviderThe db provider.