I'm driven by a relentless pursuit of innovation, turning challenges into opportunities to create impactful solutions for humanity.
+8801 PROTECTED
Dhaka, Bangladesh
I recently spent many painful hours debugging a Quartz Scheduler issue in Spring Boot with PostgreSQL.
I recently spent many painful hours debugging a Quartz Scheduler issue in a Spring Boot application using PostgreSQL.
Everything looked correct on the surface:
QRTZ_* tablesYet the jobs never executed.
The logs were filled with errors like:
Bad value for type long : \x Cannot convert the column of type BYTEA to requested type long Couldn't retrieve trigger
At first glance, this looks like a PostgreSQL schema or BYTEA issue. It is not.
This is a Spring Boot + Quartz configuration trap that is very easy to fall into.
Use this in Spring Boot:
org.quartz.jobStore.class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
Do NOT use this directly:
org.quartz.jobStore.class: org.quartz.impl.jdbcjobstore.JobStoreTX
Spring Boot already wraps JobStoreTX internally. Forcing it manually breaks job execution.
This issue is difficult because:
Most developers assume it is a PostgreSQL or Flyway problem. It is not.
In vanilla Quartz, configuration looks like this:
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
Quartz then:
This works only outside Spring.
Spring Boot:
Internally, Spring Boot uses:
LocalDataSourceJobStore -> delegates to JobStoreTX
This is intentional.
When you manually configure:
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
Quartz attempts to:
Meanwhile Spring Boot already has its own DataSource and transaction manager.
The result:
Often with no clear startup error.
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: always
properties:
org.quartz.jobStore.class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.jobStore.isClustered: true
org.quartz.jobStore.clusterCheckinInterval: 10000
org.quartz.scheduler.instanceId: AUTO
org.quartz.scheduler.instanceName: ClusteredQuartzScheduler
org.quartz.threadPool.threadCount: 5
This configuration:
LocalDataSourceJobStore:
@TransactionalThis class exists specifically for Spring.
This is correct behavior.
Quartz separates:
For one-time jobs:
This prevents database bloat and is expected.
Quartz is a scheduler, not a message queue.
Once configured correctly, Quartz is stable and production-ready.
If you are using Spring Boot with Quartz and PostgreSQL, this configuration will save you hours of debugging.
Your email address will not be published. Required fields are marked *