users@glassfish.java.net

Re: timer jobs

From: Glenn Holmer <GHolmer_at_weycogroup.com>
Date: Wed, 20 Jul 2011 14:07:03 +0000

On Mon, 2011-07-18 at 14:40 -0700, Marina Vatkina wrote:
> Glenn Holmer wrote:
> > We've started receiving the dreaded "OutOfMemoryError: unable to create
> > new native thread" on a @Schedule job. Aside from the obvious need to
> > find and fix that, our immediate concern is that @Schedule jobs appear
> > to get backed up when this happens, and do not resume even after
> > GlassFish is restarted.
> >
> > I checked this URL:
> >
> > http://localhost:8080/ejb-timer-service-app/timer
> >
> > on several machines running the same app, and on one that hasn't had
> > this problem, we see what we would expect: "There are 8 active
> > persistent timers on this container" (there are 8 @Schedule annotations
> > in our code). On two machines that have experienced this problem, we see
> > numbers of 35 and 31.
> >
>
> This is strange. No "new" timers should be created.
> > I have two questions:
> >
> > 1) How do we purge those "stuck" timer jobs?
> > 2) What happens if I use "persistent=false" in the @Schedule annotation?
> > Will they still run if the server is restarted, or only on a deploy?
> >
>
> "persistence=false" would mean create on restart.

We changed all @Schedule annotations in the app to "persistent=false"
and deleted all entries from the timer persistence table before
deploying it. If anyone needs the steps for doing that, I can provide
them.

-- 
____________________________________________________________
Glenn Holmer                          gholmer_at_weycogroup.com
Software Engineer                        phone: 414-908-1809
Weyco Group, Inc.                          fax: 414-908-1601