On 29-07-2026 16:37, 'Hugo Larson' via firebird-java wrote:
> Three exeptions.
>
> 26-07-29 16:28:53|
> org.firebirdsql.gds.ng.wire.version13.V13WireOperations
> [Thread-7|]:org.firebirdsql.logging.JulLogger debug Could not load
> EncryptionPluginSpi:
> org.firebirdsql.gds.ng.wire.crypt.chacha.ChaChaEncryptionPluginSpi
> java.lang.ClassNotFoundException:
> org.firebirdsql.gds.ng.wire.crypt.chacha.ChaChaEncryptionPluginSpi
This one is expected (once per JVM/classloader hierarchy) on Java 8 (see
https://github.com/FirebirdSQL/jaybird/blob/e4526d8ece9c8e8d5c895015e83b6dbcc44ae441/src/main/org/firebirdsql/gds/ng/wire/version13/V13WireOperations.java#L82-L86)
The finalizer attempts to close it, but the socket was already closed.
This one is a bit odd, because it does check if the socket is still open
in the finalizer and otherwise doesn't attempt to close. I wonder if
this might be some kind of race condition or visibility problem.
____________________________________________________________________________________________________________________________________________________
> 26-07-29 16:28:54|org.firebirdsql.gds.ng.AbstractFbAttachment
> [Finalizer|]:org.firebirdsql.logging.JulLogger debug Exception on safely
> detach
> java.sql.SQLException: Error writing data to the connection.
> [SQLState:08006, ISC error code:335544727]
This one is the same as the previous one. I guess you intended to copy:
```
26-07-29
16:39:21|org.firebirdsql.jaybird.xca.FBStandAloneConnectionManager
[Finalizer|]:org.firebirdsql.logging.JulLogger debug Exception closing
unmanaged connection:
java.sql.SQLException: No connection established to the database server
[SQLState:08003, ISC error code:337248273]
at
org.firebirdsql.gds.ng.FbExceptionBuilder$Type$1.createSQLException(FbExceptionBuilder.java:618)
at
org.firebirdsql.gds.ng.FbExceptionBuilder$ExceptionInformation.toSQLException(FbExceptionBuilder.java:571)
at
org.firebirdsql.gds.ng.FbExceptionBuilder.toSQLException(FbExceptionBuilder.java:309)
at
org.firebirdsql.gds.ng.wire.AbstractFbWireDatabase.checkConnected(AbstractFbWireDatabase.java:135)
at
org.firebirdsql.gds.ng.AbstractFbDatabase.close(AbstractFbDatabase.java:175)
at org.firebirdsql.gds.impl.GDSHelper.detachDatabase(GDSHelper.java:163)
at
org.firebirdsql.jaybird.xca.FBManagedConnection.destroy(FBManagedConnection.java:358)
at
org.firebirdsql.jaybird.xca.FBStandAloneConnectionManager.connectionClosed(FBStandAloneConnectionManager.java:57)
at
org.firebirdsql.jaybird.xca.FBManagedConnection.notify(FBManagedConnection.java:1081)
at
org.firebirdsql.jaybird.xca.FBManagedConnection.close(FBManagedConnection.java:995)
at org.firebirdsql.jdbc.FBConnection.closeMc(FBConnection.java:479)
at org.firebirdsql.jdbc.FBConnection.close(FBConnection.java:451)
at com.borland.dx.sql.dataset.Database.closeConnection(Database.java:423)
at com.borland.dx.sql.dataset.Database.finalize(Database.java:1053)
at java.lang.System$2.invokeFinalize(System.java:1270)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:102)
at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:217)
```
Here, it is the finalizer of com.borland.dx.sql.dataset.Database that
closes the connection, but the underlying physical connection was
already closed (probably by the finalizer).
---
It seems to be a connection leak in your application, and then
finalizers running in an indeterminate order, meaning sometimes
underlying objects are already finalized while a dependent object
expects it to be still there and not yet finalized/closed for their
finalization (possibly with a race condition or thread visibility
issue). Combined with that "Rollback not completed" warning, it also
means that you leak connections with an active transaction (i.e. didn't
explicitly commit or rollback). If these are transactions modifying
data, you might be losing data.
I guess that your code needs to explicitly close instances of
com.borland.dx.sql.dataset.Database. (Maybe in a finally explicitly call
its closeConnection() method or some other close method?)
The fact that you now see those "Rollback not completed" warnings in
Jaybird 5 compared to Jaybird 4 is likely given the change from
synchronized to ReentrantLock objects, and some other thread-safety
changes I made. I guess I have removed something that previously
established a happens-before relation, causing some checks to
incorrectly pass now while they previously failed (and then maybe caused
an exception that would be ignored somewhere or even thrown out to the
finalizer thread).
In short, make sure you actually close your
com.borland.dx.sql.dataset.Database instances.
In the meantime, I'll see if I shouldn't just get rid of some of those
finalizers (e.g. in practice, transactions are only eligible for GC if
the connection is eligible for GC, so finalizing them seems to be
unnecessary busy-work), and I'll try to track down and fix the apparent
thread-safety issue.
Mark
--
Mark Rotteveel