pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3365: EOFException on PreparedStatement#toString with unset bytea parameter since 42.7.4
Date: Mon, 26 Aug 2024 12:21:14 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
By the way, it looks like the statement has `InputStream` for a `bytea` placeholder, so `.toString()` consumes the stream, and subsequent `.toString()` calls fail as they can no longer consume the stream.
Previously, `toString()` returned `?` for `bytea`, so it was not an issue. It looks like the solution here would be to detect `.toString()` and store all the corresponding `InputStreams` buffer so we can replay them.
----
In any case, it looks like adding statements to `ConcurrentSkipListSet` does not sound good, and I believe it should be removed.
> PLStatement below is a wrapper around PreparedStatement)- not knowing of the characteristics of the object being put into it of course
If you do not care about the contents of `PreparedStatement` (`.toString()` does not compare the statements perfectly anyway), you could rather use `System.identityHashCode(preparedStatement)` for the statement comparison.
It would yield a stable comparison, and it would not cause excessive resource consumption within `.toString()`.
However, I still think disabling the statement cache would be the right thing as it would reduce CPU consumption, it would reduce memory consumption, and it would probably improve the performance at the same time.
view thread (34+ 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 #3365: EOFException on PreparedStatement#toString with unset bytea parameter since 42.7.4
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