It's not a secret anymore!*
The moose likes Servlets and the fly likes Should I make my servlet sleep? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Should I make my servlet sleep?" Watch "Should I make my servlet sleep?" New topic
Author

Should I make my servlet sleep?

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I have hita design wall. I am working with a group that is writing some stuff to my database. I want to be able to process the information.

I could do it as the info come in or as a nightly job. However, I would like to make all of my configurations for this within the scope of my web app. For instance, I do not want to write a cron job to start a nightly process and I really don't want to write any PL-SQL from my oracle db to do stuff either.

What should I do?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What container are you using?

I believe Resin has a <run-at> attribute for servlets.
It won't be portable but it might work for you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I use Tomcat.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There have actually been a lot of discussions about the pros and cons of managing your own threads from within a webapp on the tomcat-user's mailing list in the last two weeks.

You can search the whole thing at either http://marc.theaimsgroup.com
or at http://www.mail-archive.com
Search on the term "daemon" or "threads".

It would be a last-resort for me.
 
 
subject: Should I make my servlet sleep?
 
Similar Threads
How to configure in Ant?
Weblogic Nightly Deployment
Incremental filename script
Your local Versioning best practices
how to write a shell script to deploy the application??