TransactionScope - error in Reader.Read()
Posted by: Vivek Agrawal
Date: September 29, 2014 09:23AM

Connector version - 6.9.4 (I have tried with earlier version as well and the same exception was thrown)
Visual Studios 2008 , Windows XP SP3, MySQL Serve 5.6

I am getting error when I use TransactionScope. The code in TransactionScope works fine for the first time but when I try to perform the same operation on any other record while reading the it throws error.

The operation I am performing the copying records from 2 or more tables and copy as new records and want to make sure that while copying either records for all tables are insert or none (Commit or rollback).

Using the statement - using (TransactionScope scope = new TransactionScope())

Am I missing something ?? Are there any setting which needs to be done to use TransactionScope in MYSQL. The same code works fine after removing transactionscope.

System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="MySql.Data"
StackTrace:
at MySql.Data.MySqlClient.NativeDriver.FetchDataRow(Int32 statementId, Int32 columns)
at MySql.Data.MySqlClient.Driver.FetchDataRow(Int32 statementId, Int32 columns)
at MySql.Data.MySqlClient.ResultSet.GetNextRow()
at MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlDataReader.Read()

Options: ReplyQuote


Subject
Written By
Posted
TransactionScope - error in Reader.Read()
September 29, 2014 09:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.