On 30-08-2021 16:39,
amolna...@gmail.com wrote:
> I get "WARNING: Specified statement was not created by this connection"
> from org.firebirdsql.jdbc.FBConnection:158.
>
> I upgraded to 4.0.3.java8 few months ago. Never seen this message before
> with JayBird 2.x and 3.x. (8 years of JayBirdr usage)
>
> Is this a sign of a JayBird bug, or a bug in my application?
This is a Jaybird bug, and a benign one at that. This is logged by
Jaybird 3 and 4 if a statement close is notified on a connection, but
that connection doesn't have the statement in its list of active
statements (which should mean it is already closed or was never created
by the connection to begin with).
The problematic path is if a statement prepare throws an exception,
because then the statement is not registered with the connection. I
already fixed this issue in Jaybird 3.0.5, however, for Jaybird 4, I
made a basic boolean error:
Jaybird 3:
if (stmt instanceof FBPreparedStatement && ((FBPreparedStatement)
stmt).isParamSet == null)
Jaybird 4:
if (stmt instanceof FBPreparedStatement && ((FBPreparedStatement)
stmt).isInitialized())
I should have negated isInitialized().
So instead of logging this for FBStatement or *initialized*
FBPreparedStatement, it now logs this for FBStatement or *uninitialized*
FBPreparedStatement.
I'll fix this for Jaybird 4.0.4 and Jaybird 5:
https://github.com/FirebirdSQL/jaybird/issues/674
Mark
--
Mark Rotteveel