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

Validate that the connection string does not contain Enlist=False #660

Open
ramonsmits opened this issue Feb 12, 2024 · 0 comments
Open
Labels

Comments

@ramonsmits
Copy link
Member

Describe the feature.

A customer had an issue where delayed delivery was not working as expected. The problem was causes by a wrong connection string. The connection string had the value Enlist=False. The default value is True and is the required value for consistency when having a distributed transaction between the MSMQ transport and the SQL database:

The ConnectionString property supports a keyword, Enlist, which indicates whether Microsoft.Data.SqlClient will detect transactional contexts and automatically enlist the connection in a distributed transaction. If Enlist=true, the connection is automatically enlisted in the opening thread's current transaction context. If Enlist=false, the SqlClient connection does not interact with a distributed transaction. The default value for Enlist is true. If Enlist is not specified in the connection string, the connection is automatically enlisted in a distributed transaction if one is detected when the connection is opened.

Source: https://learn.microsoft.com/en-us/sql/connect/ado-net/system-transactions-integration-with-sql-server?view=sql-server-ver16#connection-string-keywords

We could validate if the connection string does not have Enlist=False set as that would generate duplicate delayed messages.

Additional Context

No response

@ramonsmits ramonsmits changed the title Validate that the connection string does not contains Enlist=False Validate that the connection string does not contain Enlist=False Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant