org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'DefaultDB': java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>. [See nested exception: java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>.]

Terracotta Project Issue Tracker | Tobias Oberlies | 1 year ago
  1. 0

    When an JobPersistenceException is caught in the main QuartzSchedulerThread loop, the loop continues and immediately retries to read the triggers from the database. This leads to 120 to 1500 database connection attempts *per second* (\!!). This leads to a flood of error log entries on our server. Quartz should automatically throttle the retry attempts in case of database connection errors. The first exception (and only one logged by Quartz directly) is {noformat} 2015 10 10 18:58:06#+00#ERROR#org.quartz.core.ErrorLogger##anonymous#global_QuartzSchedulerThread#na#services#dispatcher#web##An error occurred while scanning for the next triggers to fire. org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'DefaultDB': java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>. [See nested exception: java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>.] at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:778) at org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:71) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3784) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2756) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:272) Caused by: java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>. at org.quartz.utils.JNDIConnectionProvider.getConnection(JNDIConnectionProvider.java:163) at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108) at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:775) ... 4 more| {noformat}

    Terracotta Project Issue Tracker | 1 year ago | Tobias Oberlies
    org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'DefaultDB': java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>. [See nested exception: java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>.]
  2. 0

    Quartz causes 120 to 1500 connection attempts per second when DB is not available

    GitHub | 2 months ago | oberlies
    org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'DefaultDB': java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>. [See nested exception: java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>.]
  3. 0

    Quartz not scaling well

    terracotta.org | 1 year ago
    org.quartz.JobPersistenceException: Couldn't acquire next trigger: Couldn't retrieve trigger: No record found for selection of Trigger with key: 'DEFAULT.6da64b5bd2ee-894279e1-a6bd-4151-bb9d-77acf5647ade' and statement: SELECT * FROM QSMS_SIMPLE_TRIGGERS WHERE SCHED_NAME = 'xxx' AND TRIGGER_NAME = ? AND TRIGGER_GROUP = ?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    org.quartz.JobPersistenceException: Couldn't retrieve trigger sqlserver

    Stack Overflow | 2 years ago | Vijay
    org.quartz.JobPersistenceException: Couldn't acquire next trigger: Couldn't retrieve trigger: Transaction (Process ID 248) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [See nested exception: org.quartz.JobPersistenceException: Couldn't retrieve trigger: Transaction (Process ID 248) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. [See nested exception: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 248) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.]]
  6. 0

    Quartz JDBCJobstore doesn't work

    Stack Overflow | 7 years ago
    org.quartz.JobPersistenceException: Couldn't acquire next trigger: Field 'PRIORITY' doesn't have a default value [See nested exception: java.sql.SQLException: Field 'PRIORITY' doesn't have a default value]

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/DefaultDB' <exception details from driver>.

      at org.quartz.utils.JNDIConnectionProvider.getConnection()
    2. quartz
      QuartzSchedulerThread.run
      1. org.quartz.utils.JNDIConnectionProvider.getConnection(JNDIConnectionProvider.java:163)
      2. org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108)
      3. org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:775)
      4. org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:71)
      5. org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3784)
      6. org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2756)
      7. org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:272)
      7 frames