Question

What I understand from the below code is that whenever the server either crash or I stop the deployed artifact inside the server, the Persistent=false should clean the timer meaning that whenever the application is working again, it won't try to run jobs that should have been ran. So from my point of view, this is a bug from JBoss AS 7.1.1, but I couldn't find fix/workaround for this.

@Singleton
public class RetrieveScheduledJob
{           
    @Schedule(minute = "0,10,20,30,40,50", hour = "*", persistent = false)
    synchronized public void runRetrieve() throws InterruptedException
.
.
.
}

Another minor issue is that, because of the above issue, I might have the same job running in parallel. I tried to fix with synchronized and @Singleton, but maybe I`m missing something.

JDK1.7_u45
JBoss AS 7.1.1

Thanks

Was it helpful?

Solution

Did you check that with a fresh AS instance, maybe you have deployed first with "persistent=true" and there was a bug in AS that the schedule is not removed from the persistence if you change the flag from true to false.

This is solved in a later version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top