2013-03-01 56 views

回答

2

在Java EE 6(WebSphere 8及更高版本)中添加了非持久性EJB计时器。

如果您需要在WebSphere 7个非持久性计时器你应该需要使用AlarmManager

0

更可取的方法与EJB-3.0是清除在服务器关闭/启动所有计时器避免计时器坚持因故障。通过实施ApplicationListener接口,或者你可以参考hereonApplicationEndonApplicationStart,但前者是更好 -

您可以将代码放在适当的方法。

否则,可以运行命令以显式取消定时器,如文档中所述。

cancelEJBTimers

This command cancels and removes from persistent storage EJB timers based on the specified filter criteria. 

The syntax for this command is: cancelEJBTimers server filter [options] filter: -all | -timer | -app [-mod [-bean ]] 
      -all 
      -timer timer id 
      -app application name 
      -mod module name 
      -bean bean name 

    options: -host host name 
      -port portnumber 
      -conntype connector type 
      -user userid 
      -password password 
      -quiet 
      -logfile filename 
      -replacelog 
      -trace 
      -help 

在EJB-3.1,与TimerConfig你可以用setPersistent(isPersistent)配置。