We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3a19891 + efcd550 commit c2c9ce2Copy full SHA for c2c9ce2
1 file changed
stdlib/sql.go
@@ -555,6 +555,12 @@ func (c *Conn) ResetSession(ctx context.Context) error {
555
return driver.ErrBadConn
556
}
557
558
+ // Discard connection if it has an open transaction. This can happen if the
559
+ // application did not properly commit or rollback a transaction.
560
+ if c.conn.PgConn().TxStatus() != 'I' {
561
+ return driver.ErrBadConn
562
+ }
563
+
564
now := time.Now()
565
idle := now.Sub(c.lastResetSessionTime)
566
0 commit comments