{"record":{"id":"c849b58eef2d8dcb","repo":"tursodatabase/turso","slug":"transactioncompleted","errorCode":null,"errorMessage":"TransactionCompleted","messagePattern":"TransactionCompleted","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs","lineNumber":60,"sourceCode":"    public override IsolationLevel IsolationLevel => _isolationLevel;\n\n    public override bool SupportsSavepoints => true;\n\n    protected override DbConnection? DbConnection => Connection;\n\n    public new virtual SqliteConnection? Connection => _connection;\n\n    internal bool IsCompleted => _completed;\n\n    internal bool WasRolledBackExternally => _externalRollback;\n\n    internal global::Turso.TursoTransaction? ManagedTransaction => _managedTransaction;\n\n    public override void Commit()\n    {\n        ThrowIfCompleted();\n        if (_externalRollback)\n            throw new InvalidOperationException(Properties.Resources.TransactionCompleted);\n\n        if (_managedTransaction is not null)\n        {\n            try\n            {\n                _managedTransaction.Commit();\n            }\n            catch (global::Turso.TursoRemoteSqlException ex) when (ex.IsStreamExpired)\n            {\n                Complete();\n                throw SqliteCommand.ToSqliteException(ex);\n            }\n            catch (Turso.Raw.Public.TursoException ex)\n            {\n                if (_managedTransaction.IsCompleted)\n                    Complete();\n                throw SqliteCommand.ToSqliteException(ex);\n            }","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/tursodatabase/turso/blob/6c7252267988c76e632af00a671e4b9788dfae13/bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs#L42-L78","documentation":"Guard firing inside Commit (also reached from CommitAsync) when the transaction can no longer be committed — it was already committed or rolled back (ThrowIfCompleted) or was rolled back externally. The TransactionCompleted marker identifies end-of-life state on this SqliteTransaction; the faulting input is reusing a finished transaction.","triggerScenarios":"Thrown at bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Commit or roll back exactly once per transaction; track completion in your own code","Check the transaction state (IsCompleted / WasRolledBackExternally where accessible) before calling Commit","Discard the reference after Commit/Rollout and create a new transaction for subsequent work"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c7252267988c76e632af00a671e4b9788dfae13","analyzedAt":"2026-09-06T07:15:26.990Z","contentChangedAt":"2026-09-06T07:15:26.990Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}