I have created a quartz job in Jmix (1.5) that must be running every 2 minutes and fetch data from a third-party system. Due to the fact that sometimes the process requires more than 2 minutes to get completed, I wish to prevent another job instance to be executed until the first one is get completed. I tried to use the annotation “DisallowConcurrentExecution” on the specific job class definition but it seems not to be working as expected. So, I would like to ask you what is the recommended way of preventing a job instance to be created until the previous one is completed.
Thank you,
George
Hello.
Actually,
@DisallowConcurrentExecution
should work.
Important point - it designed to prevent concurrent execution of some single
Job Details instance
based of some
Job Class
. If you have multiple Jobs (Job Details instances) based on the same Job Class (with
@DisallowConcurrentExecution
) - they still can run at the same time.
Please check and confirm you have only one Job based on you Job Class.
Hi Ivan,
Actually, there are three different scheduled jobs based on the same Job Class that are running. So, now it makes sense.
Thank you,
George
Development a CRM solution for non-profit organization
How non-profit-organization, Fundacion Educacional Arco Iris Bajo el Sol ...
learn more
Customer
stories