开发者

.NET - SqlConnectionStringBuilder.AsynchronousProcessing

开发者 https://www.devze.com 2023-02-16 11:09 出处:网络
Maybe a silly question, but I\'m wondering why, when using SqlConnectionStringBuilder, I would ever want to make .AsynchronousProcessing false. I\'m sure it\'s my inexperience, but I can\'t figure out

Maybe a silly question, but I'm wondering why, when using SqlConnectionStringBuilder, I would ever want to make .AsynchronousProcessing false. I'm sure it's my inexperience, but I can't figure out what the purpose of not allowing a con开发者_如何学运维nection created with a particular connection string to be ran on a separate thread would be. When would I want to actively prevent this from happening?


Setting Async=true in the connection string gives a small performance penalty (e.g. when opening a SqlConnection) because for the SqlConnection to be able to execute commands async then it must have been created using Windows Async I/O, which has a little overhead compared to Windows Sync I/O.

0

精彩评论

暂无评论...
验证码 换一张
取 消