title: scheduledExecutorService, timerService and Stateless EJB on scheduled jobs
body: <p>I'm trying to implement a system in server that will do some updates on database on a ragular basis.</p>
  
  <p>Here: <a href="https://stackoverflow.com/questions/7499534/spawning-threads-in-a-jsf-managed-bean-for-scheduled-tasks-using-a-timer">Spawning threads in a JSF managed bean for scheduled tasks using a timer</a> 
  and in some other similar questions, I saw that BalusC strongly recommended to use Stateless Beans, if not possible SchedulerExecuterService rather than Timer.</p>
  
  <p>Here is my situation. I need a JSF page in which I can configure the schedule interval. i.e. I can change its rule from <strong><em>run once in every 5 min</em></strong> to <strong><em>run once in 10 min</em></strong></p>
  
  <p>First, I tried to use @Schedule annotation and it was great. However, I couldn't find a way to change interval with that. First question, is it possible to change it dynamically like I told above?</p>
  
  <p>I am currently using SchedulerExecutorService which is called from @PostConstruct of a Stateless Bean.
  Second question, is the Timer BalusC strongly recommended <strong>not</strong> to use is the TimerService of EJB?</p>
  
  <p>Third Question, I liked the properties of timerService which is:
  <em>using scheduleExpression</em> and <em>timerConfig</em>. 
  Are there any similar things for ScheduledExecutorService?</p>
  
  <p>Additional Question: Am I on right track? Can the thing that I am trying to pull be done in a better way?</p>