Locks limit the number of jobs that access the same resources, e.g. databases, in parallel.
Locks allow mutual exclusive access, i.e. jobs wait without any consumption of CPU for a lock to be released.
Use of Locks
Resource Contention Management
- Locks in the JobScheduler prevent the execution of a job, as long as a particular lock has been acquired by one or more other jobs. Locks are available for individual jobs and for jobs in job chains. Should a job be waiting for a lock to be released (lock contention), then it will be automatically started as soon as the lock has been released. In the mean time no resources such as CPU or memory are consumed by job waiting for a lock.
- For a lock you configure how many jobs could use the lock non-exclusively, i.e. in parallel.
- A job can acquire multiple locks and can use them in exclusive or non-exclusive mode.
- If a lock is used non-exclusively then other jobs that use the same lock can start in parallel until the maximum number of non-exclusive jobs is reached.
- If a job uses the lock in exclusive mode then other jobs with the same lock have to wait until the lock is released.
Maintenance Window Management
- Locks can be assigned to jobs in non-exclusive mode for an unlimited number of parallel jobs.
- During a maintenance window such a lock can be assigned the value zero for the maximum number for parallel non-exclusive jobs.
- As a result no jobs will be executed during that maintenance window.
- At the end of the maintenance window the original value is restored to an unlimited number of parallel non-exclusive jobs.
- All jobs that have been queued during the maintenance window will start at the end of the maintenance window.