pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: tatsuo-ishii (@tatsuo-ishii) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #3107: JDBC driver sends "SAVEPOINT" query without finishing extended query protocol cycle
Date: Thu, 01 Feb 2024 11:20:57 +0000
Message-ID: <[email protected]> (raw)

**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.

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] issue #3107: JDBC driver sends "SAVEPOINT" query without finishing extended query protocol cycle
  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