MCPcopy
hub / github.com/jackc/pgx / invalidateCachesOnBatchResultsError

Function invalidateCachesOnBatchResultsError

batch.go:495–509  ·  view source on GitHub ↗

invalidates statement and description caches on batch results error

(conn *Conn, b *Batch, err error)

Source from the content-addressed store, hash-verified

493
494// invalidates statement and description caches on batch results error
495func invalidateCachesOnBatchResultsError(conn *Conn, b *Batch, err error) {
496 if err != nil && conn != nil && b != nil {
497 if sc := conn.statementCache; sc != nil {
498 for _, bi := range b.QueuedQueries {
499 sc.Invalidate(bi.SQL)
500 }
501 }
502
503 if sc := conn.descriptionCache; sc != nil {
504 for _, bi := range b.QueuedQueries {
505 sc.Invalidate(bi.SQL)
506 }
507 }
508 }
509}
510
511// ErrPreprocessingBatch occurs when an error is encountered while preprocessing a batch.
512// The two preprocessing steps are "prepare" (server-side SQL parse/plan) and

Callers 2

CloseMethod · 0.85
CloseMethod · 0.85

Calls 1

InvalidateMethod · 0.65

Tested by

no test coverage detected