Search code examples
javajakarta-eeejbweblogicscheduled-tasks

Java EE Scheduled task


I need to schedule a task to be run periodicily (e.g every 6 hours, or maybe everyday at 12 PM) on Weblogic 10.3 server. The task basically retrieves some data from the database and does some business logic with it.

What is the best way to achieve this? I have searched the internet, and found some solutions like:

  • Using the Timer Service.
  • Work Managers.
  • EJB Timers.

And BTW, I am still learning JavaEE so maybe this is a basic question or I am missing something.


Solution

  • When running under a JavaEE container, you should avoid using the JDK's standard Timer feature. You should use EJB timers instead; favour those over any proprietary solution (I think that Work Managers are proprietary to WebLogic).

    Start here: http://docs.oracle.com/javaee/6/tutorial/doc/bnboy.html