Subject Re: [Firebird-Java] Firebird finalizer
Author Mark Rotteveel
I assume you are using one connection per thread (or at least: not share
connections with multiple threads).

This problem can be avoided by explicitly closing statements instead of
letting the finalizer handle this. As too the cause of the problem, I
have no idea. It looks like Jaybird is waiting for a response of the server.

Mark

Kanka sumatra wrote:
> My application which is using Firebird classic (2.1.1) hangs.
> There are multiple threads spawned off and all of them do inserts and
> reads and return except for one. On viewing the threads via jconsole it
> seems to be blocked on firebird's finalizer. The jconsole output is listed
> below. Can anyone throw some light on this please?
> We are using hibernate and spring and I do not see any open connections
> issue.
> Thanks in advance.
> Jconsole o/p:
> --------------------------------
> Name: Finalizer
> State: RUNNABLE
> Total blocked: 528 Total waited: 147
>
> Stack trace:
> java.net.SocketInputStream.socketRead0(Native Method)
> java.net.SocketInputStream.read(Unknown Source)
> org.firebirdsql.gds.impl.wire.XdrInputStream.read(XdrInputStream.java:242)
> org.firebirdsql.gds.impl.wire.XdrInputStream.readInt(XdrInputStream.java:187)
> org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.nextOperation(AbstractJavaGDSI\
> mpl.java:2099)
> org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGD\
> SImpl.java:2053)
> org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlFreeStatement(AbstractJ\
> avaGDSImpl.java:1405)
> - locked org.firebirdsql.gds.impl.wire.isc_db_handle_impl@c9d6ed
> org.firebirdsql.gds.impl.GDSHelper.closeStatement(GDSHelper.java:314)
> org.firebirdsql.jdbc.AbstractStatement.close(AbstractStatement.java:326)
> - locked org.firebirdsql.jdbc.FBPreparedStatement@599060
> org.firebirdsql.jdbc.AbstractStatement.finalize(AbstractStatement.java:192)
> java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
> java.lang.ref.Finalizer.runFinalizer(Unknown Source)
> java.lang.ref.Finalizer.access$100(Unknown Source)
> java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
> --------------------------------


--
Mark Rotteveel