Version: 2.3.2
Platform: Any (confirmed on Windows)
Reproduction
- Build a graph for a project
- Delete any tracked source file
- Run
code-review-graph build . or code-review-graph update .
Result:
sqlite3.OperationalError: cannot start a transaction within a transaction
Root cause
GraphStore.remove_file_data issues DELETE statements without committing. Python sqlite3's default isolation_level="" opens an implicit transaction on the first DML statement. The subsequent parallel-parse loop then issues BEGIN IMMEDIATE — SQLite rejects it because a transaction is already open.
Fix
Add store.commit() after the stale-removal loops in both full_build and incremental_update in incremental.py. The watcher path (~line 603) already does this correctly and is the reference pattern:
# after stale file removal loop
if removed_any:
store.commit()
Apply the same pattern to full_build (~line 360) and incremental_update (~line 485).
Version: 2.3.2
Platform: Any (confirmed on Windows)
Reproduction
code-review-graph build .orcode-review-graph update .Result:
Root cause
GraphStore.remove_file_dataissuesDELETEstatements without committing. Python sqlite3's defaultisolation_level=""opens an implicit transaction on the first DML statement. The subsequent parallel-parse loop then issuesBEGIN IMMEDIATE— SQLite rejects it because a transaction is already open.Fix
Add
store.commit()after the stale-removal loops in bothfull_buildandincremental_updateinincremental.py. The watcher path (~line 603) already does this correctly and is the reference pattern:Apply the same pattern to
full_build(~line 360) andincremental_update(~line 485).