users@glassfish.java.net

Persistent timers problem

From: <forums_at_java.net>
Date: Tue, 27 Sep 2011 05:34:31 -0500 (CDT)

I am using Glassfish 3.1. I wrote an EJB that creates persistent Timer
objects (on demand) and adds them to TimerService. Timer runs until
I restart a server.

For some reason, after restart timerService.getServices() return only the
newly created timers and not the persisted. Also, the timer doesn't run after
restart. @Resource private TimerService timerService; public void
startTimer(String id){ timerService.createIntervalTimer(0, 6000, new
TimerConfig(id, true/*persist timers*/)); } @Timeout public void
sendAlerts(Timer timer){ String id = timer.getInfo().toString();
logger.debug("Sending a timed alert for "+ serviceID); } I see that the timer
is persisted (it appears in glassfish asadmin command:
http://[server]:8080/ejb-timer-service-app/timer )   Am I missing something?
thanks for any help in the subject

--
[Message sent by forum member 'okna2000']
View Post: http://forums.java.net/node/847384