开发者

Pairing Email Transactions and ADO.NET Transactions [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_如何学运维 Closed 10 years ago.

Is it possible to automatically link the sending of an email (using SMTPClient) in C# with an ADO.net transaction?

So given the scenario of the sending of an email failing, the ADO.NET transaction will also fail and be automatically rolled back?

Cheers


Yes, you need to send your mail within a transaction context and wait for completion, then just roll back transaction on any exception or commit it if there is no any. There is no common way to do this.


You can rollback the transaction (or transaction scope) if an error sending the mail occurs. (As long as you don't want to undo the mail send as part of the transaction rollback... ;) )

However, I'm not sure what you mean by "automatic" linking; a failed e-mail send does not automatically perform a rollback.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜