TMyEmbConnection: Second connection failed.

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

TMyEmbConnection: Second connection failed.

Post by easyblue » Mon 10 Jul 2006 09:02

Hello

For a strange problem in my project, I created a test application for TMyEmbConnection.

Environment is Win2k+MySQL v4.1.20

I found that if I used TMyEmbConnection, I must set the Params "--skip-innodb". Otherwise, the second connection always fails unless the user manually delete all the ibdata files in the datadir.

It is a MyDAC problem, or MySQL problem?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 11 Jul 2006 14:20

This is MySQL Embedded Server issue. Please see following threads for more information:
- Trouble with myembconection
- Assertion failure...

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

Post by easyblue » Wed 12 Jul 2006 04:24

Hello

The connection is not established during design time.

As my project only use MyISAM type engine, so such setting is a work around for me.
But if my project need InnoDB engine, then it seems TMyEmbConnection have problem with the lastest MySQL classic server (v4.1.20), that for the second connection, the ibdata files must be deleted manually first, otherwise connection is always a failure.

So I would like to verify whether the problem is due to MySQL server or MyDAC component.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 12 Jul 2006 13:36

If I make application that works with embedded server (--skip-innodb option is off) and close IDE, I can run the application, open dataset and exit the application. If I run the application again, I'll be able to open dataset again. But if I try to open two instances of the application that work with the same database at the same time, I'll get error when establishing second connection. This is MyDAC behaviour to prevent embedded server crash and data corrupting.

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

Post by easyblue » Thu 13 Jul 2006 00:59

Hello

I made a test project, and showing TMyEmbConnection has compatible problem with MySQL v4.1.20.

You can do the following to make a test:

Drop one TMyEmbConnection and two TButton components to a form,
the TButtons are corresponding to "
MyEmbConnection1->Connect(), and MyEmbConnection1->Disconnect() respectively.

Build the application, and check the libmysqld.dll and share/english/... are existing in the path.

Run the application, upon connect(), ibdata files will be created. Disconnect and reconnect again, all has no problem.

Now you exit the application, start the application again, click connect, and error messages are coming out.

I can also provide the test project source code on demand.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 13 Jul 2006 08:25

This is MySQL Embedded Server bug. The only solution we can suggest is refusal to use InnoDB storage engine with embedded server.

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

Post by easyblue » Thu 13 Jul 2006 08:46

Is it possible to submit it to MySQL company about this bug?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 13 Jul 2006 09:23

You can try, but from our experience it's unlikely that there will be success. Possibly this problem will be solved in embedded server of 5.1 version.

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

Post by easyblue » Fri 11 Aug 2006 12:32

Hello

The reason is finally located in MySQL server version.

For copyright reason, we have purchased and used classic version of MySQL server, which is no transaction supported.
So in this point of view, inno DB is naturely disabled. Besides, it must also be disable from server parameter setting.

So now TMyEmbConnect works perfectly in our application.

Post Reply