Issue Details (XML | Word | Printable)

Key: JDBC-519
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

Jaybird should explicitly call fb_shutdown() on VM exit when using Firebird Embedded

Created: 07/Feb/18 02:52 PM   Updated: 20/Apr/19 09:07 AM
Component/s: JDBC driver, JNI/JNA layer
Affects Version/s: Jaybird 3.0.0, Jaybird 3.0.1, Jaybird 3.0.2, Jaybird 3.0.3, Jaybird 3.0.4, Jaybird 4
Fix Version/s: Jaybird 4

Issue Links:

 Description  « Hide
If the JVM exits and there are still connections open using Firebird Embedded, then the exit may produce an access violation (0xc0000005 error). The root cause is that the fbembed.dll/fbclient.dll will call fb_shutdown() itself, but one of the other libraries (eg fbintl.dll) may already have been unloaded.

To prevent this, Jaybird should register a shutdown hook that explicitly calls fb_shutdown for any of the native libries loaded (but especially for embedded).

See also "Crash Firebird 2.5.8 Embedded with Firebird provider." on Firebird-devel.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 04/Aug/18 11:35 AM
Calling fb_shutdown on JVM exit is not good enough, for web applications that might introduce memory leaks on undeploy.

Mark Rotteveel added a comment - 09/Feb/19 03:25 PM
See for an issue related to not shutting down.

Mark Rotteveel added a comment - 20/Apr/19 09:07 AM
Implemented cleanup handling of native libraries both on JVM exit and on servlet destroy if the driver is loaded from a WAR. Feature can be disabled using system property org.firebirdsql.nativeResourceShutdownDisabled set to true (eg -Dorg.firebirdsql.nativeResourceShutdownDisabled=true on Java command line).