users@glassfish.java.net

Re: How could I implement and deploy a background process in Glassfish?

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Jan 2008 13:48:41 PST

The primary differences between Quartz and EJB Timer are:

1) that EJB Timer runs in the EJB tier, whereas Quartz runs in the Servlet Tier (an EJB Timer is implemented as a Session bean).

2) The timer scheduling model. Quartz has a more "cron like" scheduling model "run every Tuesday", "run at 15 after the hour", etc. whereas EJB Timer is simpler and basically can run at a specific time, or at a specific time and "every N seconds" after.

#2 tends to be most folks sticking points with the EJB Timer.

The other detail is that once an EJB Timer is created (notably recurring timers), there's no need to recreate it since they're persistent. So, you have to bootstrap the service. That can be confusing for folks to that initialize the timer in an init servlet, and naively recreate the timer each container start.

I didn't have any real problem with the EJB Timer service, but it could use a little richer interface and could well do to be exposed on the Admin GUI. It's one of those odd hybrid application/container artifacts.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=253859