Skip to content

EnlistTransaction should not throw when called multiple times with the same transaction #619

@dennis-gr

Description

@dennis-gr

EnlistTransaction should check whether the given transaction is the same as the one it is already enlisted in and do nothing in that case. That would match the behaviour of MySql.Data and other providers.

Test to reproduce:

[Fact]
public void EnlistingInTheSameAmbientTransactionMultipleTimesDoesNotThrow()
{
	using (new TransactionScope())
	{
		using (var connection = new MySqlConnection("AutoEnlist=false"))
		{
			connection.Open();
			
			connection.EnlistTransaction(Transaction.Current);
			connection.EnlistTransaction(Transaction.Current);
		}
	}
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions