Create a task for sending e-mail instead of calling the mailservice
directly.

use this in your task (a task can be part of a transaction)

try{
...
} catch (Throwable thr) {
 log.error(...);
}

and all exceptions will be catched.  I think a task will be re-executed only
if it fails (throws an exception).




On Sat, Jul 10, 2010 at 6:43 PM, Marcus Brody <[email protected]> wrote:

> Hello,
>
> I would like to ask, if there is some way how to send mail only in
> case that some db transaction will be successful.
> I am not very experienced with gae, but I did study it now for about 2
> weeks.
>
> Desired output:
>
>          1) prepare email
>          2) db transaction.begin()
>          3) do some db operation
>          4) bind sending mail with current transaction (similar to
> how can you can attach Task to queue)
>          5) db transaction.commit()
>
> I am aware that I can queue mail sending task to task queue, but i
> cannot find the way how to do that mail sending task Idempotent
> without (i think) complicated locking mechanism .
> Most simple solution would be to put mail sending task to task queue,
> but this means mail could be send twice in some rare situation. (this
> is maybe not that bad but if there is some way how to avoid it, I
> would like to know)
>
> Thank you,
>
> Marcus
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to