Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 799
Eng.Fouad Avatar asked Nov 27 '12 07:11

Eng.Fouad


1 Answers

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

like image 77
Isaac Avatar answered Oct 05 '22 09:10

Isaac