Harden ROLLBACK against I/O errors in transactions
If the original error (e.g., disk full) also prevents ROLLBACK from executing, catch and suppress the ROLLBACK failure so the original exception propagates cleanly and the connection isn't left in a permanently broken state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
3
db.py
3
db.py
@@ -295,7 +295,10 @@ class ProjectDB:
|
||||
self.conn.execute("COMMIT")
|
||||
return df_id
|
||||
except Exception:
|
||||
try:
|
||||
self.conn.execute("ROLLBACK")
|
||||
except Exception:
|
||||
pass
|
||||
raise
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user