Uploaded image for project: 'appNG Scheduler'
  1. appNG Scheduler
  2. SCHED-21

Scheduler does not work with MSSQLDelegate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 1.11.4, 1.11.5
    • Fix Version/s: 1.11.6
    • Labels:

      Description

      I am using MSSQL and have configured the Property quartzDriverDelegate=org.quartz.impl.jdbcjobstore.MSSQLDelegate

      This works fine with the scheduler version 1.11.3

       

      The newer versions use the appng DriverDelegateWrapper and the JobStoreSupport is not initialized correctly because Quartz handles MSSQLDelegate separately.

      Relevant code org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(ClassLoadHelper, SchedulerSignaler) line 664

      if (getUseDBLocks()) {
                      if(getDriverDelegateClass() != null && getDriverDelegateClass().equals(MSSQLDelegate.class.getName())) {
                          if(getSelectWithLockSQL() == null) {
                              String msSqlDflt = "SELECT * FROM {0}LOCKS WITH (UPDLOCK,ROWLOCK) WHERE " + COL_SCHEDULER_NAME + " = {1} AND LOCK_NAME = ?";
                              getLog().info("Detected usage of MSSQLDelegate class - defaulting 'selectWithLockSQL' to '" + msSqlDflt + "'.");
                              setSelectWithLockSQL(msSqlDflt);
                          }
                      }
                      getLog().info("Using db table-based data access locking (synchronization).");
                      setLockHandler(new StdRowLockSemaphore(getTablePrefix(), getInstanceName(), getSelectWithLockSQL()));
                  }

       
      Stack trace:

      2018-03-20 11:59:27,310 ERROR business.SchedulingController : error starting job 'indexJob' of application appng-scheduler (type isorg.appng.application.scheduler.job.IndexJob)
      org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Zeile 1: Die FOR UPDATE-Klausel ist nur für DECLARE CURSOR zulässig. [See nested exception: com.microsoft.sqlserver.jdbc.SQLServerException: Zeile 1: Die FOR UPDATE-Klausel ist nur für DECLARE CURSOR zulässig.]
      	at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:157)
      	at org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:113)
      	at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:238)
      	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1091)
      	at org.quartz.core.QuartzScheduler.addJob(QuartzScheduler.java:938)
      	at org.quartz.core.QuartzScheduler.addJob(QuartzScheduler.java:927)
      	at org.quartz.impl.StdScheduler.addJob(StdScheduler.java:268)
      	at org.appng.application.scheduler.business.SchedulingController.start(SchedulingController.java:73)
      	at org.appng.core.service.InitializerService.startApplication(InitializerService.java:765)
      	at org.appng.core.service.InitializerService.loadSite(InitializerService.java:732)
      	at org.appng.core.service.InitializerService.loadSite(InitializerService.java:442)
      	at org.appng.core.service.InitializerService.loadSite(InitializerService.java:427)
      	at org.appng.application.manager.service.ManagerService.reloadSite(ManagerService.java:1389)
      	at org.appng.application.manager.service.ManagerService$$FastClassBySpringCGLIB$$bbf10b1e.invoke(<generated>)

        Attachments

          Activity

            People

            • Assignee:
              mueller.matthias Matthias Müller
              Reporter:
              c.brueckner Christian Brückner
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: