Workflow Engine .NET

Assembly: OptimaJet.Workflow.SQLite

Class WorkflowSync

OptimaJet.Workflow.SQLite.Models.WorkflowSync

Database object for workflow synchronization lock operations.

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
schemaName
String
The database schema name.
commandTimeout
Int32
The 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
connection
SqliteConnection
The SQLite connection.
name
String
The 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
connection
SqliteConnection
The SQLite connection.
name
String
The lock name.
oldLock
Guid
The current lock value.
newLock
Guid
The new lock value to set.
transaction
SqliteTransaction
An optional transaction.

Returns

Type
Description
Task<Int32>
The number of rows affected (0 if the lock was changed by another process).