Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should I make my servlet sleep?

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Tomcat.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic