pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] PR #3655: fix: ensure Connection.isValid() returns true even if prepared statements deallocate
Date: Fri, 06 Jun 2025 11:28:29 +0000
Message-ID: <[email protected]> (raw)

Previously, the code for `.isValid()` was using `executeWithFlags("", QueryExecutor.QUERY_EXECUTE_AS_SIMPLE)`

However, the execution still went with extended query protocol since `QueryExecutorImpl#updateQueryMode` trimmed the flag in `preferQueryMode=extended` (default) mode.

It does not feel right to trim the flag there since the intention of the option was to "prefer" query mode unless specified explicitly.

The case is identified and tested in `AutoRollbackTest`: isValid should return true after statements like DEALLOCATE, `DISCARD`, and so on.

See https://github.com/pgjdbc/pgjdbc/pull/3631
Fixes https://github.com/pgjdbc/pgjdbc/issues/3630


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #3655: fix: ensure Connection.isValid() returns true even if prepared statements deallocate
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox