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 on
I doubt that it's possible to implement true XAResource for SMTP. There should be transaction support on the resource manager (SMTP server in this case) and I don't believe there are any. I would say your best bet is 'Last resource commit' pattern - which allows one non XA resource participate in XA transaction. Search Google, there are plenty of info. Most Java EE servers supports this.