集群模式下带lockoninsert = false的石英

Jav*_*der 6 java quartz-scheduler

我有4个节点的应用程序。有时我所有的工作都会卡住,等待“ QRTZ_LOCKS中的*选择*,其中lock_name ='TRIGGER_ACCESS'用于更新”

在阅读某些文章时,有人建议使用此属性关闭全局锁定

org.quartz.jobStore.lockOnInsert=false
Run Code Online (Sandbox Code Playgroud)

有没有人试图在集群模式下运行Quartz lockoninsert=false?我打算使用以下配置

#============================================================================
# Configure Main Scheduler Properties  
#============================================================================

org.quartz.scheduler.instanceName = StandardScheduler
org.quartz.scheduler.instanceId = AUTO

#============================================================================
# Configure ThreadPool  
#============================================================================

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 3
org.quartz.threadPool.threadPriority = 5

#============================================================================
# Configure JobStore  
#============================================================================

org.quartz.jobStore.misfireThreshold = 300000

org.quartz.jobStore.class=org.springframework.scheduling.quartz.LocalDataSourceJobStore
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.useProperties=false
org.quartz.jobStore.tablePrefix=QRTZ_
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.lockOnInsert=false
org.quartz.jobStore.acquireTriggersWithinLock=true
org.quartz.jobStore.lockHandler.class=org.quartz.impl.jdbcjobstore.UpdateLockRowSemaphore

org.quartz.scheduler.jmx.export=true
Run Code Online (Sandbox Code Playgroud)

小智 3

A found some comment in the 1.8.6' source

    public boolean isLockOnInsert() {
            return lockOnInsert;
        }

        /**
         * Whether or not to obtain locks when inserting new jobs/triggers.  
         * Defaults to <code>true</code>, which is safest - some db's (such as 
         * MS SQLServer) seem to require this to avoid deadlocks under high load,
         * while others seem to do fine without.  
         * 
         * <p>Setting this property to <code>false</code> will provide a 
         * significant performance increase during the addition of new jobs 
         * and triggers.</p>
         * 
         * @param lockOnInsert
         */
Run Code Online (Sandbox Code Playgroud)