EJB Timer change the next timeout

Hi,
I use EJB timer to launch processes and I'd like to change the timeout time of the timer without restarting the server.
I tried cancelling all the timers and then creating new timers, but I get the exception:
this Timer has either expired or been canceled and therefore cannot be invoked

How can I do that?

Tanx
kmapperAsked:
Who is Participating?
 
krakatoaConnect With a Mentor Commented:
You could just schedule a new timertask inside your present run(), and cancel the old one.
0
 
kmapperAuthor Commented:
Yeah, thats what I tried to do but once I cancelled the old ones, I get this message when a creates new ones:
this Timer has either expired or been canceled and therefore cannot be invoked
0
 
krakatoaCommented:
Well the test class I ran seemed to make the change ok. Can you post some code perhaps?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
kmapperAuthor Commented:
hmm.... I noticed the problem is not there when I cancel the process and then exit the EJB (timed service) and then create the new timer.

Otherwise if I cancel the timer and create the new ones in the same method i get an exception. I guess this has something to do with EJB instanciation??
0
 
krakatoaCommented:
Do you want to post the code for the method attempt?
0
 
kmapperAuthor Commented:
Heum... no I guess it's fine now :)

tanx anyways!
0
 
krakatoaCommented:
Fair enough. ;) k.
0
All Courses

From novice to tech pro — start learning today.