Page 1 of 1

Two Applications with a embeded mysql server

Posted: Tue 14 Oct 2008 10:31
by dejestiny2
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. :(

Posted: Fri 17 Oct 2008 11:15
by Challenger
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;

Posted: Fri 17 Oct 2008 15:43
by dejestiny2
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