File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes Tips for coding a lengthy operation  Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Other Languages » Groovy
Reply Bookmark "Tips for coding a lengthy operation  " Watch "Tips for coding a lengthy operation  " New topic
Author

Tips for coding a lengthy operation

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3158

Hey,
In our application, we have to send a SMS (and even emails) to hundreds of users.
Since this operation could be lengthy, what is the best approach to code it?
I mean, should I embed it into a thread (all the code will be in Grails service)?
Should I launch it via Ajax in order not to hijack the UI?
Your corrections and suggestions are more than welcome.
Thanks for help and time.
Gregg Bolinger
Sheriff

Joined: Jul 11, 2001
Posts: 15021

A couple of ways I might implement this are to either use quartz (there's a plugin) and schedule the task or I might just use a old school cron job. I'd say your main concern is not allowing this task to be kicked off more than once at a time by multiple users.

This message was edited 1 time. Last update was at by Gregg Bolinger



My Blog | DZone Articles
 
 
subject: Tips for coding a lengthy operation
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com