Is it a recommended practice to send SMTP from with a C# TransactionManager transaction scope?
Trying to troubleshoot a questionable plugin a client is experiencing issues with in production, and one possible issue I see is the fact that they're sending SMTP synchronously from within our heavily-transacted C# web application. In the past I believe I've read or been told that sending SMTP synchronously from within a transaction is a开发者_开发百科 precarious bet, but I can't seem to find anything to back it up that I can present to the client's dev team.
I think more generally that the problem is; does the e-mail send truly need to be part of the transaction, especially since sending an e-mail does not necessarily mean anything about whether the message is received?
Given the unreliability of e-mail in general, it seems like a bad fit for something to put in a transaction - where you are looking for a set of items to absolutely complete as a group, or not at all; How do you know if the e-mail actually, absolutely, has been received?
Assuming then that they agree that the e-mail should not be part of the transaction scope itself, it becomes extra fluff - fluff that takes time, holding up the transaction for something technically unrelated.
精彩评论