Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Vernon Day   on Mar 04 In Java Category.

  
Question Answered By: Edith Mcdonald   on Mar 04


for(//all items in the list)
{
try
{
//send email
//insert in db
}
catch (Exception e)
{
//log the error for futher reference ( or error correction mechanism )
//for exmaple if an email  is not sent it should be loged to be retried or recovered in future
// or if something is not inserted it should be logged to be retried or recovered in future

continue;
}
}


ps: I think in your scenario sending  email and inserting  something in db should be performed in one shot, so it would be better if you consider a transaction for both of them.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 


Tagged: