Page 1 of 1

TransactionScope not working with dotConnect for MySQL 5.50?

Posted: Mon 22 Feb 2010 15:00
by Sancha
Hello every one !

I'm trying to use the TransactionScope class in my C# application.
Here's my code :

Code: Select all

using (TransactionScope t = new TransactionScope(TransactionScopeOption.RequiresNew))
            {
                MySqlConnection cn = new MySqlConnection();
                cn.ConnectionString = connectionString;
                cn.Open();
                MySqlCommand c = new MySqlCommand("INSERT INTO operateur.privileges(alias) VALUES('plop')", cn);
                c.ExecuteNonQuery();
                MySqlCommand c2 = new MySqlCommand("INSERT INTO operateur.privileges(alias) VALUES('plop2')", cn);
                c2.ExecuteNonQuery();
                t.Complete();
            }
On the cn.Open(), I get an error :
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'XA BEGIN 'dc8e807b-222b-b3c4-e44c-a9be85f7dd88,-a9fb-cf5eb572459f'' at line 1

If I execute the same code not using the TransactionScope, it works perfectly...

Have you got an idea of what is the issue?

Thank you for helping me !

Posted: Tue 23 Feb 2010 12:47
by Shalex
I have checked your code with the latest 5.70.97 version of dotConnect for MySQL. It works without errors. Please try 5.70.97 and notify us about the results. If the problem persists, post here your call stack.

Posted: Tue 23 Feb 2010 13:42
by Sancha
Thank you very much for your answer.
I have downloaded and installed the version 5.70 but, I have the same error...

I think is my MySql version...

Posted: Wed 24 Feb 2010 08:21
by Shalex
Please specify the exact version (x.x.xx) of your MySQL Server and post here your connection string. Is your current build 5.70.97? You can find it in the Tools | MySQL | About menu of Visual Studio.