Consider the following code:
using (var connection = new XConnection(...))
{
connection.Open();
using (var transaction = connection.BeginTransaction())
using (var cmd = connection.CreateCommand()
{
Console.WriteLine(cmd.Transaction == null);
}
}
Connector/NET, SqlConnection and NpgsqlConnection all print true; MySqlConnector prints false because .Transaction is set to the active transaction. We should follow the pattern of other ADO.NET connectors and require .Transaction to be set explicitly.
It's possible this could be affecting #333 if commands are being created with an active transaction, then used again after that transaction is committed.
Consider the following code:
Connector/NET,
SqlConnectionandNpgsqlConnectionall printtrue; MySqlConnector printsfalsebecause.Transactionis set to the active transaction. We should follow the pattern of other ADO.NET connectors and require.Transactionto be set explicitly.It's possible this could be affecting #333 if commands are being created with an active transaction, then used again after that transaction is committed.