0

I wonder what is the difference between persistent and non persistent timers. I have done a simple sample one using

@Schedule(hour = "*", minute = "5", second = "*/5", info = "Persistent timer")

and the second time

@Schedule(hour = "*", minute = "5", second = "*/5", info = "Nonpersistent timer",persistent = false)

The application was deployed on Weblogic and it has exaclty the same behaviour for both timers.

In theory the difference is

Timers are persistent by default. If the server is shut down or crashes, persistent timers are saved and will become active again when the server is restarted. If a persistent timer expires while the server is down, the container will call the @Timeout method when the server is restarted.

Nonpersistent programmatic timers are created by calling TimerConfig.setPersistent(false) and passing the TimerConfig object to one of the timer-creation methods.

So to say in the first case I stopped the server (simulating a crash BUT the timer was not triggered one was up , just when the new timeout was executed.

Any idea ? Thanks

Cris
  • 4,947
  • 6
  • 44
  • 73
  • If I read the timer correctly it should fire every five seconds within the fifth minute of every hour. Did you have your container stopped for the whole hour while you were testing it? – Korgen Apr 26 '16 at 19:03
  • yes....it seems to be a weblogic BUG ...on wildfire it worked...(i adapted the timers to test sooner :) – Cris Apr 26 '16 at 19:20
  • See also: . I'm not sure if that's an exact duplicate, so not closing. – Brett Kail Apr 27 '16 at 15:53

0 Answers0