[jboss-user] [EJB 3.0] - Re: Timer event is always handled by a new instance?

galaxoid do-not-reply at jboss.com
Thu Sep 21 02:12:05 EDT 2006


@Resource 
private SessionContext ctx;
@Resource(mappedName="java:/DefaultDS")
private DataSource defaultDs;

public void createTimer() throws CustomException {
   try {
       Connection conn = defaultDs.getConnection();
       Statement stmt = conn.createStatement();
       stmt.execute("delete from TIMERS");
       TimerService timerService = ctx.getTimerService();
       timerService.createTimer(20000, 300000, "I'm a chinese, english is not good.");
   } catch (Throwable ex) {
       LogHome.getLog().error("", ex);
       throw new CustomException(ex);
   } 
}


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973154#3973154

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973154



More information about the jboss-user mailing list