Friday, April 22, 2016

Bug in MySql .NET Connector 6.9.8: Nested transactions are not supported

There is bug in MySQL connector for .NET version 6.9.8, that it will throw an error: “Nested transactions are not supported”


You have likely run into this bug in MySQL Connector/NET.
What triggers this bug:
  1. Code calls for execution of query A
  2. Transaction 1 for query A is started
  3. Query A is executed and causes an error in MySQL
  4. Transaction 1 is NOT rolled back
  5. Code calls for execution of query B
  6. Transaction 2 for query B is started
  7. MySQL Connector/NET throws the exception
The bug is point 4: transaction 1 is left open after an error (or at least the connector is still convinced it's left open). Because of connection pooling, the code calling for query A and query B can be completely unrelated. Also, if the time between point 4 and 5 is long enough, the transaction is rolled back, hence the rareness and randomness.
Unfortunately there's no fix by MySQL yet. The only workaround that I know of is downloading the source code of Connector/NET and fixing/building it yourself.
Otherwise, stick to the older stable version 6.8.7
Thanks: AronVanAmmers
Reference: http://stackoverflow.com/a/29265962/1931848

No comments:

Post a Comment