Two Applications with a embeded mysql server

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dejestiny2
Posts: 4
Joined: Tue 14 Oct 2008 10:28

Two Applications with a embeded mysql server

Post by dejestiny2 » Tue 14 Oct 2008 10:31

Hallo, i have a big problem with mysql embedded server.

I have two applications. This applications work on same database(tables are MyISAM and TEmbConnection has disable using innodb) - first application only writes data to database and secound application this data only read from database.

When i firt run application to reading data a then run secound application and write same data to database, so this changes
aren't visible for firt application(reading). Changes are visible only when i close and again run application for reading. TMyConnection->Connect(),disconnect() have no effect.

Can you tell me, how solve this problem? Thank you very much. :(

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 17 Oct 2008 11:15

MyDAC does not allow connecting to a single empedded database from several applications. You should disconnet connection in the first application before connecting in the second one. You should also free MySQL library explicitly:

Code: Select all

  uses
    MySQLApi;
  if MyAPIEmbedded  nil
    MyAPIEmbedded.FreeMySQLLib;

dejestiny2
Posts: 4
Joined: Tue 14 Oct 2008 10:28

Post by dejestiny2 » Fri 17 Oct 2008 15:43

Maybe i have a solution. This works fine for me. If i run multiple instances of a same application from a same application directory so i get error " Cannot run second Embedded Server instance for a single data... ". But, when i create a copy of the application directory and then run first instance from the original directory and than run second instance from the copy of the directory so all work fine - no errors(every copy of the application directory has own copy of a libmysqld.dll)

Can i use this solution? Thanks

Post Reply