FreeLibrary upon Disconnect

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
easyblue
Posts: 64
Joined: Wed 02 Feb 2005 13:02
Location: Shanghai

FreeLibrary upon Disconnect

Post by easyblue » Wed 25 Aug 2010 15:41

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?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 26 Aug 2010 10:11

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;

easyblue
Posts: 64
Joined: Wed 02 Feb 2005 13:02
Location: Shanghai

thanks.

Post by easyblue » Thu 26 Aug 2010 13:08

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:

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 26 Aug 2010 13:39

Thank you for your inquiry. We will investigate the possibility of adding this functionality in the future.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 14 Feb 2011 09:19

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.

Post Reply