延迟发送邮件直到交易提交 [英] Delaying sending of mail until transaction commits
本文介绍了延迟发送邮件直到交易提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
如果您只需要等待提交,就像您在评论中说的那样,您可以使用 TransactionSynchronizationManager.registerSynchronization )
来触发电子邮件发送。
Does anyone have a good tutorial or some advice on how to implement one's own XAResource? I need Spring's MailSender to be transactional, so that the mail will only be sent once the transaction commits, and it seems there isn't any existing transactional wrapper.
解决方案
If you just need to wait for the commit, as you say in a comment, you can investigate using TransactionSynchronizationManager.registerSynchronization()
to trigger email sending on commit.
这篇关于延迟发送邮件直到交易提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文