MCPcopy
hub / github.com/autobrr/qui / Commit

Method Commit

internal/database/db.go:403–414  ·  view source on GitHub ↗

Commit commits the transaction and releases the writer mutex if this is a write transaction. Also promotes any transaction-prepared statements to the DB cache for future use. On failure, the transaction remains active - caller must call Rollback() to release the mutex.

()

Source from the content-addressed store, hash-verified

401// Also promotes any transaction-prepared statements to the DB cache for future use.
402// On failure, the transaction remains active - caller must call Rollback() to release the mutex.
403func (t *Tx) Commit() error {
404 err := t.tx.Commit()
405 if err == nil {
406 // Commit succeeded - promote statements to cache
407 t.promoteStatementsToCache()
408 // Release mutex only on successful commit (for write transactions)
409 if t.unlockFn != nil {
410 t.unlockOnce.Do(t.unlockFn)
411 }
412 }
413 return err
414}
415
416// Rollback rolls back the transaction and releases the writer mutex if this is a write transaction.
417// Always releases the mutex since the transaction is done (either rolled back successfully,

Callers

nothing calls this directly

Calls 3

DoMethod · 0.80
CommitMethod · 0.65

Tested by

no test coverage detected