Steven Elliott wrote: > > I wholeheartedly disagree with the FAQ @ Distributopia. I > think servlets are the best way to schedule tasks >
I'd say that's going a bit far. There are obvious drawbacks. > and they can be packaged with your application on whatever > platform that you deploy on. > Using a servlet container as an application server is undeniably appealing, and very convenient. If all you've got is a hammer, etc, etc. I've found that many people fall into the "Well, it works fine for me" trap. Instead of programming to the spec, they program to whatever servlet container they happen to be using for development work. Sometimes you have to settle for that, but no programmer should aspire to it. At the very least, developers should be aware of potential problems and consciously choose to trade safety for convenience. That's the whole point of the FAQ. I'm curious what you suggest should happen if the user's servlets are swapped out during the time the task should be running. Is the background thread destroyed, in which case the task doesn't run? Or do you leave it running, in which case you've got a resource leak? If you're depending on your particular servlet container never doing something like that, well, that's probably ok. But you may get a nasty shock the next time you upgrade your server. At the very least, people should know that there's a potential problem, and document it for the benefit of future maintainers. -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>