Commits on Source 2

  • cznic's avatar
    fix inconsistent transaction state on failed Commit · 806ed2d1
    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
    806ed2d1
  • cznic's avatar
    add GOVERNANCE.md · c777b906
    cznic authored
    c777b906
Loading
Loading