-
1. Re: How to send an email after the transaction completes?
mediamana Apr 11, 2010 10:47 AM (in response to dro_k)hello,
I think interceptor will do the job very well
kecopa
-
2. Re: How to send an email after the transaction completes?
raphaufrj Apr 11, 2010 2:22 PM (in response to dro_k)Hi Drew,
i think in your case you have to observe the event org.jboss.seam.afterTransactionSuccess.yourEntitySimpleName. For sending emails, you should prefer using @Asynchronous.
Best Regards,
-
3. Re: How to send an email after the transaction completes?
asookazian Apr 12, 2010 10:19 PM (in response to dro_k)To deal with first item in your list, perhaps XA/2PC (distributed tx and you may even look into JMS p2p/queue)
Not sure about 2nd item unless you force eager loading...
-
4. Re: How to send an email after the transaction completes?
asookazian Apr 12, 2010 10:22 PM (in response to dro_k)If you were to observe org.jboss.seam.afterTransactionSuccess.yourEntitySimpleName how does Seam know which instance of the successful tx commit it needs to observe (i.e. what if there are two successful commits for entity foo simultaneously)?
And what if you don't want to send the email in both cases?
-
5. Re: How to send an email after the transaction completes?
kapitanpetko Apr 13, 2010 3:33 AM (in response to dro_k)Simply use Events.raiseTransactionSuccessEvent(). You can pass your entity as a parameter. Just need to initialize all field you need and detach it. Or copy the info you need to another object/map. That takes care of both 1 and 2.