users@glassfish.java.net

Re: Dynamic redeployment and EJB Timers

From: Dobes Vandermeer <dobesv_at_gmail.com>
Date: Mon, 2 Feb 2009 09:34:20 -0800 (PST)

No, for now timers are deleted on redeploy, and that's the intended behavior.
You'll have to write your code to reinstate all its timers when it is
deployed. You could create an entity bean and store a copy of your timers
in your own database, for example.

Ideally this is how the timer service would work anyway - store the
persistent timers in a location of your choice and let you decide whether
they are deleted when you redeploy. But the timer service is currently is a
very barebones state and lacks a lot of convenience features that would make
it so much more useful for advanced uses.

As it is I suggest using it for just one or two persistent timers that you
manually reschedule and use those to scan your database and decide what to
do on a regular basis. Creating a lot of special-purpose timers could
create a potentially unlimited number of threads and cause other issues ...
timers are not very safe to use and are difficult to manage in the presence
of redploys and restarts.



glassfish-2 wrote:
>
> Is there some easy way to redeploy an application without losing its EJB
> Timers? The only method I have found that works is a bit cumbersome:
> shutdown GlassFish, update applications/j2ee-apps by hand, and then
> restart GlassFish.
>
> I am using GlassFish v2.1-b60e on Linux.
>
> Björn
> [Message sent by forum member 'bjornd' (bjornd)]
>
> http://forums.java.net/jive/thread.jspa?messageID=328929
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/Dynamic-redeployment-and-EJB-Timers-tp21726807p21794246.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.