• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

web application question

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am developing a web application which sells books online.
Once an user buys a books from this site then 2 things should happen,

1) An Email confirming the order details, amount and shipping details should be sent to the user.
2) Also an SMS confirming the same order details, amount and shipping details should be sent to the user.

If i do it like first email and next sms then any problem in sending email is not allowing the sms sending to trigger.

Question: What is the better approach (apart from thread based approach) to make sure, the sending email and sending sms are independent of each other ?
Failure in one should not obstruct the other.

Thanks in advance
Kalyan
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi Kalyen,

You can surround the code for sending email and sms with 2 different try-catch blocks.
Ex:



 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic