Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Fri, 06 Jun 2025 11:28:29 +0000 Subject: [pgjdbc/pgjdbc] PR #3655: fix: ensure Connection.isValid() returns true even if prepared statements deallocate List-Id: X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Issue: 3655 X-GitHub-Labels: bug X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3655 Content-Type: text/plain; charset=utf-8 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