pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: manav-yb (@manav-yb) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3889: JDBC Not Sending CLOSE packet
Date: Sun, 07 Dec 2025 15:16:56 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Expecting CLOSE to validate pstmt.close() is sent. 
But from server point of view, not sending actual CLOSE message, I see 2 problems and solutions as well, please correct me if I'm wrong.
1) There can be a resource leak if lot of prepared statements unused been prepared on a long lived backend. But JDBC is configuring it with help of preparedStatementCacheQueries, developer can set it to 0 but he/she won't get advantage of shared prepared statements.
2) On schema change it can cause an Error - "Cached plan must not change result type". Because CLOSE has not  been explicitly send by driver even application has written pstmt.close(). But given JDBC has a the mechansim to retry (when it receives such error) it silently by sending actual CLOSE message followed by new PARSE packet. 

Are there are any other known problems which has or has not workaround.

view thread (4+ 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 #3889: JDBC Not Sending CLOSE packet
  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