Transaction.Commit() failing

Transaction.Commit() failing

Postby dextor » Tue 01 Nov 2005 08:38

Hi,

I'm migrating an existing app from Advantage to MySQL but i'm having trouble getting the transactions to work. For example my code might go like this

myCmd.Transaction = myCmd.Connection.BeginTransaction();
myCmd.ExecuteNonQuery();
...
...
myCmd.Transaction.Commit();


The problem is that the Commit() fails with exception 'System.NullReferenceException: Object reference is not set to an instance of an object'.

Code like this works fine with Advantage using the standard VS OLEDB components but not with MySQL and the CoreLab components.

I'm using v2.80 compoents and i've tried both v4.1 and v5.0 of MySQL with both MyISAM and INNODB tables.

Anyone any ideas???

Thanks

Dex
dextor
 
Posts: 3
Joined: Tue 01 Nov 2005 08:28

Postby Serious » Tue 01 Nov 2005 09:45

We have fixed this problem for MySQLDirect .NET.
Until new build will be released you have to store result of MySqlConnection.BeginTransaction() method.
Note that in MySQL transactions and connections have one-to-one relation, so all commands associated with some connection will have single shared transaction object.
Serious
 


Return to dotConnect for MySQL