Uploaded image for project: 'Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)'
  1. Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)
  2. QTZ-209

MySQL jdbc driver gives SQLException when batch count is > 0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Core
    • Labels:
      None
    • Terracotta Target:
      Quartz 2.1.0
    • Fixed In Revision:
      1671

      Description

      I get this exception when setting "org.quartz.scheduler.batchTriggerAcquisitionMaxCount = 4" using MySQL jdbc driver.

      2011-09-15 18:41:12,109 DEBUG org.quartz.impl.jdbcjobstore.JobStoreTX:3941| MisfireHandler: scanning for misfires...
      2011-09-15 18:41:12,109 DEBUG org.quartz.impl.jdbcjobstore.JobStoreTX:3179| Found 0 triggers that missed their scheduled fire-time.
      2011-09-15 18:41:16,171 ERROR org.quartz.core.ErrorLogger:2353| An error occurred while scanning for the next triggers to fire.
      org.quartz.JobPersistenceException: Couldn't acquire next trigger: Illegal value for setFetchSize(). [See nested exception: java.sql.SQLException: Illegal value for setFetchSize().]
              at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2837)
              at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2752)
              at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3807)
              at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2748)
              at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264)
      Caused by: java.sql.SQLException: Illegal value for setFetchSize().
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
              at com.mysql.jdbc.StatementImpl.setFetchSize(StatementImpl.java:2530)
              at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setFetchSize(NewProxyPreparedStatement.java:1567)
              at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTriggerToAcquire(StdJDBCDelegate.java:2562)
              at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2778)
              ... 4 more
      

      I think the cause is that MySQL setFetchSize will use maxRows value for validation. So to fix it, we can simply reverse the order of in StdJDBCDelegate.selectTriggerToAcquire():

      setMaxRows(int)
      setFetchSize(int)
      

      If I do this, would it affect other driver?

        Attachments

          Activity

            People

            • Assignee:
              jhouse James House
              Reporter:
              light5 Zemian Deng
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: