FB 2.5 introduced a new API function fb_shutdown that clients should call before unloading (FreeLibrary) fbclient.dll when they don't need it anymore. In some cases this may cause unexpected problems such as a “connection shutdown“ error.
Usually this may happen when your client application and IBEScript.dll share the same client library (fbclient.dll). In this case IBEScript.dll doesn't know that your application needs fbclient.dll and calls fb_shutdown before FreeLibrary.
Also sometimes FreeLibrary cannot unload fbclient.dll as expected and it remains in the client process memory but already in the shutdown state. To avoid such problems we implemented the IBECallFBShutdown environment variable which controls the necessity to call the fb_shutdown function. You can set value of this variable to FALSE to avoid calling the fb_shutdown function.
execute ibeblock as begin DB = ibec_CreateConnection(...); ... ibec_SetEnvironmentVariable('IBECallFBShutdown', FALSE); ibec_CloseConnection(DB); end
In this case fb_shutdown will not be called after disconnect.
This workaround is for Firebird 2.5 only, it is not necessary to use it with Firebird 3.