当我们使用带有@schedule 和persistent=true 的持久EJBTimer 时,将其部署到集群,然后我们更改@Schedule 中的实际调度并重新部署到集群,原始调度是否被新调度替换(删除并添加了新参数),或者两个计划都保持事件状态(记住设置了persistent=true)
这是我目前阅读的内容 - Each scheduler instance has a unique jndi name and @schedule automatically creates a timer through application deployment so it would be better to remove the automatic created EJBTimer or cancel the original schedule to avoid trouble.
但我不知道如何以编程方式取消原始计划,或者如果原始计划和更改后的计划都保持事件状态,是否需要由 websphere 管理员完成
同样来自 this document ,removeAutomaticEJBTimers 命令用于从指定的调度程序中删除计时器,但这似乎也属于 websphere 管理员的领域,而不是开发人员的领域。
开发人员如何以编程方式取消使用 @Schedule 注释创建的自动 EJBTimer?
我将 Java EE 6 与 Websphere 8.5 和 EJB 3.1 一起使用。
最佳答案
执行以下操作以删除持久的 EJB 计时器:
删除目录 jboss-home\standalone\data\timer-service-data{yourporjectname}.{serivename}
关于java-ee-6 - 如何取消或删除 Persistent EJBTimers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28461187/