Loading
Commits on Source 2
-
cznic authored
If a COMMIT fails (e.g. with SQLITE_BUSY), SQLite may leave the transaction open, but database/sql expects the driver.Tx to be finished and the underlying connection to be clean when Commit() returns. This mismatch caused connection pool poisoning, where subsequent uses of the connection would fail with "cannot start a transaction within a transaction". This fix checks sqlite3_get_autocommit after a failed Commit. If the transaction is still active, it forces a ROLLBACK to reset the connection state, while still returning the original error to the caller. Fixes https://github.com/modernc-org/sqlite/issues/2
-
cznic authored