Page 1 of 1

FreeLibrary upon Disconnect

Posted: Wed 25 Aug 2010 15:41
by easyblue
Hello

I have a service, who will automatically connect to an embedded server to make certain checking, and disconnect, periodically.

Now I found that even I have disconnected from the server, I can not start a second instance for using that embedded server because dll is still loaded, unless I completely shutdown the previous one.

So is it possible to call FreeLibrary upon Disconnect instead of component destroy?

Posted: Thu 26 Aug 2010 10:11
by Dimon
MyDAC does not unload Embedded server every time after closing a connection because this is a very slow operation. If you really need to release database files during your application is working, you should add the MySqlApi unit to the uses clause and execute this code:

Code: Select all

  MyAPIEmbedded.FreeMySQLLib;

thanks.

Posted: Thu 26 Aug 2010 13:08
by easyblue
I am a little bit greedy to ask the possiblity to introduce a new property, say: "UnloadOnDisconnect". Default is false, if set true, will do such FreeLibrary operation?

:lol:

Posted: Thu 26 Aug 2010 13:39
by Dimon
Thank you for your inquiry. We will investigate the possibility of adding this functionality in the future.

Posted: Mon 14 Feb 2011 09:19
by Dimon
In the latest MyDAC build (6.00.0.4) we have added the UnloadEmbLibraryOnDisconnect variable. Its default value is False. Set UnloadEmbLibraryOnDisconnect to True for unloading MySQL Embedded server library on closing connection. This variable is declared in the MySqlApi unit.