You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Dusan8080 , from inspecting the changes, it appears the change was to resolve this issue #980 from this PR #1023. Also, is your project running .NET Framework or .NET Core? Also, what version of .NET Core were you using? The fix also aligned the code to match the behavior between .NET Core and .NET Framework.
Describe the bug
Distributed transactions are turned on. Connection string has MultipleActiveResultSets=True.
It works with:
Microsoft.Data.SqlClient 2.1.2
System.Data.SqlClient.SqlInternalConnectionTds
ExecuteTransactionYukon
if (internalTransaction != null && internalTransaction.IsDelegated)
{
if (_parser.MARSOn)
{
tdsParserStateObject = _parser.GetSession(this);
flag = true;
}
else if (internalTransaction.OpenResultsCount != 0)
{
throw SQL.CannotCompleteDelegatedTransactionWithOpenResults(this);
}
}
It throws an exception with:
Microsoft.Data.SqlClient 2.1.3
Microsoft.Data.SqlClient.SqlInternalConnectionTds
ExecuteTransactionYukon
if (internalTransaction != null && internalTransaction.IsDelegated)
{
if (_parser.MARSOn)
{
stateObj = _parser.GetSession(this);
mustPutSession = true;
}
if (internalTransaction.OpenResultsCount != 0)
{
SqlClientEventSource.Log.TryTraceEvent("<sc.SqlInternalConnectionTds.ExecuteTransactionYukon|DATA|CATCH> {0}, Connection is marked to be doomed when closed. Transaction ended with OpenResultsCount {1} > 0, MARSOn {2}", base.ObjectID, internalTransaction.OpenResultsCount, _parser.MARSOn);
throw SQL.CannotCompleteDelegatedTransactionWithOpenResults(this, _parser.MARSOn);
}
}
Between versions 2.1.2 and 2.1.3 there is change from "else if" -> "if"
Did not find anything about breaking changes between versions in release notes. Any explanation?
The text was updated successfully, but these errors were encountered: