我有一个应用程序部署在带有 Java 1.7.1 的 WebSphere 8.5 上,定义了一个由 2 个节点组成的集群。在这个应用程序中有一个 EJB,它通过工作管理器提交一个异步作业。
问题是在 WAS 8.5 上,作业在集群的两个节点上执行了两次。在 WAS 6.1 中,这并没有发生。
工作由报警管理员提交。在提取的代码下方:
WorkManager wm = serviceLocator.getWorkManager("NameOfCustomWorkManager");
AsynchScope scope = wm.findAsynchScope("scopeName");
if (scope == null)
scope = wm.createAsynchScope("scopeName");
AlarmManager alarmManager = scope.getAlarmManager();
alarmManager.create(listener, "Alarm Context Info", (int) (DateUtils.getNextTime(nextTime) - System.currentTimeMillis())); --Fired on a certain hours
logger.info("Alarm fired.");
有人知道在 8.5 上是否有额外的配置来避免所描述的问题?