tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Velja Radenkovic" <velja.radenko...@gmail.com>
Subject Starting background thread in contextInitialized ...
Date Sun, 03 Sep 2006 15:23:35 GMT
Hello,

I need to periodicaly (12 hrs) check few thousands of database records and
to perform some transactions. My first intention was to start a thread in
contextInitialized for this purpose. After searching the internet (including
this mailing list), I'm in doubt. There are lot of guys saying "Don't do
this ... don't do that... Remove the the threads from your webapp ..."
offering no explanations.

I can always schedule a cron job and start some utility which would perform
the transactions but having it all in java and all in one war is cool.

What I'm looking for are pros, cons and experiences for implementing
ServletContextListener and starting a thread in contextInitialized. Thread
neads to perform 1 min processing every 12 hrs. Reliability is most
important aspect.

Velja

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message