Is sending email transactional? I have one scheduled timer which sends multiple emails to the users and we encountered the timer timeout issue during the timer runtime. Based on the application log, the process for sending emails for some users has completed. But no email was found in email log.

Why is it so? Is it because send email is transactional like database? if any unhandled exception occurs, it roll back the transaction by default. 

Or is it that email were sent successfully but the email log was not saved due to roll back database transaction?

Thanks in advance your advice. 

Hi Aung,

When you sent an email out from OS platform , first the email details get stored in few db entities and than scheduler service sent the emails out and change the status to sent .

In your case like you said that there was an timeout error and i am assuming the email entries in the db entities gets rolled back and thus you cannot see the sent email logs.

You need to handle the timeout error and before the timer gets timeout you need to relaunch the timer.

You can refer following link to check how to use timers in better way.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Timers

https://www.outsystems.com/learn/courses/43/master-class-on-best-practices-and-timers/?StartCourse=False


Regards,

-PJ-

PRAMOD JAIN wrote:

Hi Aung,

When you sent an email out from OS platform , first the email details get stored in few db entities and than scheduler service sent the emails out and change the status to sent .

In your case like you said that there was an timeout error and i am assuming the email entries in the db entities gets rolled back and thus you cannot see the sent email logs.

You need to handle the timeout error and before the timer gets timeout you need to relaunch the timer.

You can refer following link to check how to use timers in better way.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Timers

https://www.outsystems.com/learn/courses/43/master-class-on-best-practices-and-timers/?StartCourse=False


Regards,

-PJ-

Hi PJ, 

Thank you for your comment and suggestion. 

Does it mean, email entries in the db got rolled back but the actual email were sent out by scheduler service? 



A timeout means the timer process will be killed, which indicates a rollback.
I found that if the code actually reaches an end node, at that point the actual commit is being performed, exiting via an exception will initiate a rollback.

In your case, best you can do is either create a seperate process (BPT) for each email, or restart the timer after each email that's been sent.

I would recommend using BPT for this, as you can send out multiple emails in bulk easily (thus cleaning up your email queue more quickly), even if one of them fails, it will automatically retry the failed one, however this won't inpact the other emails, so their sending won't be halted.

This is something i am still thinking ,possibly it can be a case. Can you confirm from any of the user who do you think the email process was completed.

Or you can also try the similar thing by keeping very small time for the timer timeout and process the same data , kind of debugging and write some audit so that even when it gets timeout we have our own Audit logs to check.


Regards,

-PJ-