title: Persistent vs. Nonpersitent Timers EJB 3.x
body: <p>I wonder what is the difference between persistent and non persistent timers.
  I have done a simple sample one using</p>
  
  <pre><code>@Schedule(hour = "*", minute = "5", second = "*/5", info = "Persistent timer")
  </code></pre>
  
  <p>and the second time </p>
  
  <pre><code>@Schedule(hour = "*", minute = "5", second = "*/5", info = "Nonpersistent timer",persistent = false)
  </code></pre>
  
  <p>The application was deployed on Weblogic and it has exaclty the same behaviour for both timers.</p>
  
  <p>In theory the difference is </p>
  
  <blockquote>
    <p>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.</p>
    
    <p>Nonpersistent programmatic timers are created by calling
    TimerConfig.setPersistent(false) and passing the TimerConfig object to
    one of the timer-creation methods.</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>Any idea ? Thanks</p>