{"record":{"id":"b991a64db517f47f","repo":"gastownhall/beads","slug":"set-dolt-force-transaction-commit-w","errorCode":null,"errorMessage":"set dolt_force_transaction_commit: %w","messagePattern":"set dolt_force_transaction_commit: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/versioncontrolops/conflicts.go","lineNumber":253,"sourceCode":"\t}\n\tif err := ValidateConflictStrategy(strategy); err != nil {\n\t\treturn 0, err\n\t}\n\tkeyCol, ok := conflictRowKeyColumn[table]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"per-row conflict resolution is not supported for table %s; resolve the whole table instead\", table)\n\t}\n\tif len(keys) == 0 {\n\t\treturn 0, nil\n\t}\n\t// A conflicted table cannot be written — nor the session committed —\n\t// without dolt's conflict-tolerance flags (the same pair MergeAndSettle\n\t// sets). They are session state, which is why db must be one session.\n\tif _, err := db.ExecContext(ctx, \"SET @@dolt_allow_commit_conflicts = 1\"); err != nil {\n\t\treturn 0, fmt.Errorf(\"set dolt_allow_commit_conflicts: %w\", err)\n\t}\n\tif _, err := db.ExecContext(ctx, \"SET @@dolt_force_transaction_commit = 1\"); err != nil {\n\t\treturn 0, fmt.Errorf(\"set dolt_force_transaction_commit: %w\", err)\n\t}\n\n\tresolved := 0\n\tfor _, key := range keys {\n\t\trow, err := loadConflictRow(ctx, db, table, keyCol, key)\n\t\tif err != nil {\n\t\t\treturn resolved, err\n\t\t}\n\t\tif err := resolveOneConflictRow(ctx, db, table, keyCol, key, strategy, row); err != nil {\n\t\t\treturn resolved, err\n\t\t}\n\t\tresolved++\n\t}\n\treturn resolved, nil\n}\n\n// rawConflictRow is one conflict row kept in raw scanned form, so their_*\n// values can be written straight back into the base table.","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/versioncontrolops/conflicts.go#L235-L271","documentation":"ResolveConflictRows sets a second session flag, dolt_force_transaction_commit=1, so the working set can be committed despite outstanding conflicts. Failure of this SET aborts row resolution. Like its sibling flag, this is session state; the error is a wrapped driver error from ExecContext.","triggerScenarios":"Calling ResolveConflictRows against a dolt version that predates dolt_force_transaction_commit, or on a session/connection that cannot execute SET (dead connection, restricted user, non-dolt backend).","commonSituations":"Version skew between client driver expectations and dolt server; least-privilege DB user blocked from setting session variables via middleware; intermittent connection failure between the two SET calls.","solutions":["Upgrade the dolt server to support dolt_force_transaction_commit","Check the wrapped error text for unknown-variable vs connectivity","Ensure the same single session/connection is used for the whole ResolveConflictRows call","Retry on a fresh connection"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var v string\nif err := db.QueryRowContext(ctx, \"SELECT @@dolt_force_transaction_commit\").Scan(&v); err != nil {\n    return fmt.Errorf(\"dolt version lacks force-transaction-commit support: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"n, err := versioncontrolops.ResolveConflictRows(ctx, db, table, keys, strat)\nif err != nil {\n    if strings.Contains(err.Error(), \"dolt_force_transaction_commit\") {\n        return fmt.Errorf(\"upgrade dolt server: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep dolt server at a version supporting both session flags","Use a single dedicated session for the entire resolution call","Add both SET statements to your integration smoke test"],"tags":["dolt","session-variable","database","configuration"],"backgroundTag":"unknown-system-variable","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}