Page 1 of 1

TMyEmbConnection: Second connection failed.

Posted: Mon 10 Jul 2006 09:02
by easyblue
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?

Posted: Tue 11 Jul 2006 14:20
by Antaeus
This is MySQL Embedded Server issue. Please see following threads for more information:
- Trouble with myembconection
- Assertion failure...

Posted: Wed 12 Jul 2006 04:24
by easyblue
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.

Posted: Wed 12 Jul 2006 13:36
by Antaeus
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.

Posted: Thu 13 Jul 2006 00:59
by easyblue
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.

Posted: Thu 13 Jul 2006 08:25
by Antaeus
This is MySQL Embedded Server bug. The only solution we can suggest is refusal to use InnoDB storage engine with embedded server.

Posted: Thu 13 Jul 2006 08:46
by easyblue
Is it possible to submit it to MySQL company about this bug?

Posted: Thu 13 Jul 2006 09:23
by Antaeus
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.

Posted: Fri 11 Aug 2006 12:32
by easyblue
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.