users@glassfish.java.net

Non-persistent Singleton timers in a clustered environment using GF3.1

From: Jacques <whshub_at_gmail.com>
Date: Sat, 16 Jul 2011 12:07:43 -0700

I'm trying to use non-persistent timers to fire singleton actions (for
refreshing local cache) in a clustered environment. The same code works
fine if I run it in a non-clustered environment.

I've tried both TimerService.createIntervalTimer and @Schedule annotation
and neither seems to work correctly.

When I monitor the ejb-timer-service-app I see that the timer gets created
but then it disappears after the first expiration. I don't see any errors
in the logs.

//works fine, fires every third minute for one instance in cluster
@Schedule(minute="*/3", hour="*", dayOfMonth="*", month="*", year="*")
 public void startWork(Timer t)

// Never fired. Upon deploy, all nodes in cluster show an active
non-persistent timer (via EJB timer web app). Timer disappears after what
appears to be first expiration.
@Schedule(minute="*/3", hour="*", dayOfMonth="*", month="*", year="*",
persistent=false) public void startWork(Timer t)


What is the expected functionality in a clustered singleton environment? As
described above, I know that persistent timers work fine (and are
constrained to a single instance across the cluster as expected).

Which logger would give me more information about what is happening?

Thanks,
Jacques