Making @Schedule run only once in a clustered environment
问题 I have two tomee instances clustered. Each one have a method annotated like @Schedule(dayOfWeek = "*") public void runMeDaily() {...} I'd like to run this method only once a day. Not twice a day (one on each instance) I could use a flag as described here Run @Scheduled task only on one WebLogic cluster node? or just elect some node, but I wonder if there's a more elegant way to do that. This question is somewhat related to EJB3.1 @Schedule in clustered environment but I am not using JBOSS.