# Class WorkflowSync OptimaJet.Workflow.SQLite.Models.WorkflowSync Database object for workflow synchronization lock operations. Namespace: [OptimaJet.Workflow.SQLite.Models](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite.Models/) ```csharp public class WorkflowSync : DbObject ``` ## Type Hierarchy - [DbObject](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/DbObject-TEntity/) - WorkflowSync Current type ## Constructors `public WorkflowSync(string schemaName, int commandTimeout)` Initializes a new instance of [WorkflowSync](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite.Models/WorkflowSync/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemaName` | `String` | The database schema name. | | `commandTimeout` | `Int32` | The command timeout in seconds. | ## Methods `public Task 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` | The sync entity, or `null` if not found. | `public Task 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` | The number of rows affected (0 if the lock was changed by another process). | [Previous WorkflowRuntime](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite.Models/WorkflowRuntime/)