chore: ⬆️ updated deps

This commit is contained in:
2026-05-20 22:52:20 +02:00
parent d9f27c1775
commit 43f4680176
374 changed files with 295527 additions and 301467 deletions
+18 -1
View File
@@ -33,7 +33,24 @@ func newTx(ctx context.Context, c *conn, opts driver.TxOptions) (*tx, error) {
// Commit implements driver.Tx.
func (t *tx) Commit() (err error) {
return t.exec(context.Background(), "commit")
err = t.exec(context.Background(), "commit")
if err == nil {
return nil
}
// If Commit fails (e.g., SQLITE_BUSY), the connection might still be inside
// the transaction. database/sql expects the connection to be clean (no active
// transaction) after Commit returns.
//
// We check the low-level autocommit state. 0 means autocommit is disabled =>
// we are inside a transaction.
if t.c.db != 0 && sqlite3.Xsqlite3_get_autocommit(t.c.tls, t.c.db) == 0 {
// Force a rollback to clean up the connection. We ignore the rollback error
// because we must return the original Commit error to the user.
t.exec(context.Background(), "rollback")
}
return err
}
// Rollback implements driver.Tx.