WARNING: Specified statement was not created by this connection

27 views
Skip to first unread message

amolna...@gmail.com

unread,
Aug 30, 2021, 10:39:48 AM8/30/21
to firebird-java
Hi Mark!

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?

Call stack:

Daemon System Thread [Finalizer] (Suspended (breakpoint at line 158 in FBConnection))   
    FBConnection.notifyStatementClosed(FBStatement) line: 158   
    InternalTransactionCoordinator$LocalTransactionCoordinator.statementClosed(FBStatement) line: 479   
    InternalTransactionCoordinator.statementClosed(FBStatement) line: 123   
    FBPreparedStatement(FBStatement).close(boolean) line: 361   
    FBPreparedStatement(FBStatement).close() line: 334   
    FBPreparedStatement(FBStatement).finalize() line: 186   
    System$2.invokeFinalize(Object) line: 1270   
    Finalizer.runFinalizer(JavaLangAccess) line: 102   
    Finalizer.access$100(Finalizer, JavaLangAccess) line: 34   
    Finalizer$FinalizerThread.run() line: 217    


Thank You!

Mark Rotteveel

unread,
Aug 30, 2021, 11:31:08 AM8/30/21
to firebi...@googlegroups.com
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

amolna...@gmail.com

unread,
Aug 31, 2021, 8:45:35 AM8/31/21
to firebird-java
Thanks! When will 4.0.4 be released?

Mark Rotteveel

unread,
Aug 31, 2021, 9:03:51 AM8/31/21
to firebi...@googlegroups.com
On 31-08-2021 14:45, amolna...@gmail.com wrote:
> Thanks! When will 4.0.4 be released?

I have no solid plans at this time, but probably somewhere in September.

Mark

--
Mark Rotteveel

Mark Rotteveel

unread,
Sep 26, 2021, 12:37:10 PM9/26/21
to firebi...@googlegroups.com
On 31-08-2021 15:03, Mark Rotteveel wrote:
> On 31-08-2021 14:45, amolna...@gmail.com wrote:
>> Thanks! When will 4.0.4 be released?
>
> I have no solid plans at this time, but probably somewhere in September.

I plan to release 4.0.4 in the coming week, probably next weekend.

Mark
--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages