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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

krakatoaCommented:
You could just schedule a new timertask inside your present run(), and cancel the old one.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.