Message-ID: From: "tatsuo-ishii (@tatsuo-ishii)" To: "pgjdbc/pgjdbc" Date: Thu, 01 Feb 2024 11:20:57 +0000 Subject: [pgjdbc/pgjdbc] issue #3107: JDBC driver sends "SAVEPOINT" query without finishing extended query protocol cycle List-Id: X-GitHub-Author-Id: 5737836 X-GitHub-Author-Login: tatsuo-ishii X-GitHub-Issue: 3107 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: closed X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3107 Content-Type: text/plain; charset=utf-8 **Describe the issue** If autosave=always option is specified, JDBC driver sends "SAVEPOINT PGJDBC_AUTOSAVE" in simple query protocol without finishing extended query protocol cycle. This is not recommended. A an extended query protocol cycle should be ended before sending a simple protocol query. See the discussion in pgsql-hackers: https://www.postgresql.org/message-id/20240130.082257.800729082723903188.t-ishii%40sranhm.sra.co.jp **Driver Version?** Not known. **Java Version?** Not known. **OS Version?** Not known. **PostgreSQL Version?** Not known. **To Reproduce** Steps to reproduce the behaviour: Use connection string autosave=always&cleanupSavepoints=true **Expected behaviour** The JDBC driver should end the extended query protocol cycle before sending "SAVEPOINT PGJDBC_AUTOSAVE". I am not familiar with the internal of JDBC driver but in general you could do this by either: - sending a sync message before sending "SAVEPOINT PGJDBC_AUTOSAVE". - sending "SAVEPOINT PGJDBC_AUTOSAVE" using an extended query protocol messages. Probably the latter is safer? **Logs** Not available.