We have two jobs that run the same process. One of these jobs runs on a regular schedule, and the other is available to be run on request in between these regular intervals based on business conditions.
The scenario we want to avoid is having either of these jobs run while the other is still running because this overlap can have undesired consequences.
We have thought about just having each of these jobs having a condition of the other job "not running". However, we are wondering what the outcome would be. So, if the scheduled job is running and then the on request job is submitted, we would expect that the on request job would be queued up and begin running as soon as the scheduled instance finishes.
In some cases this might be OK, but we are wondering if there is a way to just "not execute" that on request instance because it might end up being superfluous if the scheduled job is running.
We have been looking at the concept of a virtual resource whereby the total number of "units" is set to 1 and each job consumes that resource when it runs, thereby depleting it and stopping the other job from running. However, that also seems like it "queues up" the latent request so that it runs as soon as the resource is available. Again, our ideal situation might be to always have the scheduled job run and have the on request version simply "discarded" if resource is not available instead of having it queued up to run when the resource is free.
These are just two options that we have thought about, so if there are any other alternatives please let us know.
You can use the notrunning attribute in your job defionition. Example:
condition: notrunning(DB_DUMP) AND notrunning(BACKUP)
As you want to avoid these jobs to run simultaneously, the following method will guaranty they will never run at the same time:
Otherwise, you can use different type of resources.
Regarding your requirement : " ... our ideal situation might be to always have the scheduled job run and have the on request version simply "discarded"....'
in addition to the "notrunning" which will avoid to jobs to run simultaneously, you can use the following method:
resources: (renewable_res, QUANTITY=1, FREE=N)
resources: (renewable_res, QUANTITY=1, FREE=Y)
Hence, if the "on_request_job" takes the renewable resource which is set to 1,
when the job is completed, it will free the resource for the regular job to run.
While when the "regular_job" is completed, it does not free the resource immediately.
You may want to add a technical job to manage the resource at the interval you need.
I hope this can help.
You can also use done(job). Or you can use workload balancing.
Nothing in this message is intended to constitute an electronic signature unless a specific statement to the contrary is included in this message.
Confidentiality Note: This message is intended only for the person or entity to which it is addressed. It may contain confidential and/or privileged material. Any review, transmission, dissemination or other use, or taking of any action in reliance upon this message by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this message in error, please contact the sender and delete it from your computer.