users@glassfish.java.net

javax.ejb.Schedule problem

From: <forums_at_java.net>
Date: Wed, 20 Apr 2011 05:35:54 -0500 (CDT)

Hello,

does anyone have any idea why this scheduler would be kicked off multiple
times in one day?

It used to work fine, but when the application was moved from one machine to
another, the scheduler is kicked off multiple times on Saturday, although it
works fine on the other days.

I think it might have something to do with the fact that the scheduler is
persistent.

Is there are way of flushing \ resetting any information that glassfish
stores about the scheduler persistence ?

 

On Saturdays, the scheduler is kicked off at 03:30, but then gets kicked off
about once per minute after that until you restart glassfish.

Thanks in advance for any help.

 

 

 

 

 

 

import java.util.Date;
import javax.ejb.EJB;
import javax.ejb.Schedule;
import javax.ejb.Stateless;
import javax.ejb.Timer;
/**
 *
 *
 */
@Stateless
public class AutomatedQueryTimerBean {
    @EJB
    private QueryTemplatesBeanLocal queryBean;
    /**
     * Default constructor.
     */
    public AutomatedQueryTimerBean() {
    }
    @SuppressWarnings("unused")
    @Schedule(second = "0", minute = "30", hour = "3", dayOfWeek =
"Mon-Sat", dayOfMonth = "*", month = "*", year = "*", info = "MyTimer")
    private void scheduledTimeout(final Timer t) {
        System.out.println("Creating automated requests");
        final Date d = new Date();
        queryBean.createScheduledDatastreamRequests(new java.sql.Date(d
                .getTime()));
    }
}
 


--
[Message sent by forum member 'blake249']
View Post: http://forums.java.net/node/793587