Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dennis-gr opened this issue Mar 17, 2019 · 1 comment
Assignees
Labels

Comments

@dennis-gr
Copy link
Contributor

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);
		}
	}
}
@bgrainger bgrainger self-assigned this Mar 18, 2019
@bgrainger bgrainger added the bug label Mar 18, 2019
@bgrainger
Copy link
Member

Fixed in 0.50.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants