Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.util.Timer do nothing else timertask with a past time to execute

807597Sep 20 2005 — edited Sep 20 2005
hello,

I'm using a java.util.Timer to execute several tasks (0 to several 1000s) at specific date.

1- The timer is instanciate like this :
if(Robot.timer==null){
Robot.timer=new Timer(true);
}
2- I extract from DB all tasks to redo and insert theem in a Vector.

3- From this Vector, each task is schedule with :
timer.schedule(dealToSchedule,dateToInsert.getTime());
During the execution, I can see the state "redo or not" of each task in parsing the previous vector. I can see that only the six first tasks are redo. These task have passed date (if the System.currentTime is 2005-09-20 15:00PM there tasks have older date like 2005-09-20 09:00AM). But they are several other tasks with date between the six first tasks and the System.currentTime and many other tasks with date in the futur. But when their time to execute arrive, these tasks never are done !

I never destroy my Timer, I can see is pointer with :
System.out.println(Robot.timer.toString());
Somebody have an idea ?

Thx
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2005
Added on Sep 20 2005
7 comments
491 views