Class WorkflowSync
OptimaJet.Workflow.SQLite.Models.WorkflowSync
Database object for workflow synchronization lock operations.
Namespace: OptimaJet.Workflow.SQLite.Models
public class WorkflowSync : DbObject<SyncEntity>Inheritance
- Object
- DbObject<SyncEntity>
Constructors
public WorkflowSync(string schemaName, int commandTimeout) #Initializes a new instance of WorkflowSync.
Parameters
Name
Type
Description
schemaNameStringThe database schema name.
commandTimeoutInt32The command timeout in seconds.
Methods
public Task<SyncEntity> GetByNameAsync(SqliteConnection connection, string name) #Gets a synchronization lock entity by its name.
Parameters
Name
Type
Description
connectionSqliteConnectionThe SQLite connection.
nameStringThe lock name.
Returns
Type
Description
Task<SyncEntity>The sync entity, or
null if not found.public Task<int> UpdateLockAsync(SqliteConnection connection, string name, Guid oldLock, Guid newLock, SqliteTransaction transaction = null) #Updates the synchronization lock value using optimistic concurrency.
Parameters
Name
Type
Description
connectionSqliteConnectionThe SQLite connection.
nameStringThe lock name.
oldLockGuidThe current lock value.
newLockGuidThe new lock value to set.
transactionSqliteTransactionAn optional transaction.
Returns
Type
Description
Task<Int32>The number of rows affected (0 if the lock was changed by another process).