I have a Timer that runs as a deamon. To this Timer I add one single TimerTask to run each 60 sec. The Timer is instantiated by the init() method of a
servlet at application startup.
The problems is that the Timer starts TWO different threads with the TimerTask. Both threads run once every 60 sec, and simingly with about 5 seconds between them.
This is very strange because as far as I can see my code should only start ONE
thread. What might be wrong? What can I do to make sure the timer only starts ONE thread?
Here's my code (a bit simplified):
This should be a fairly simple setup of a Timer, and I can't understand why it would start two separate threads with the TimerTask!?
As a note I can mention that in my application there's another Timer in another class (which has nothing to do with this class). It is possible to have more than one Timer within the same JVM, right?
Hope somone can help!
[ November 19, 2006: Message edited by: Egil Poma ]