michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
249 stars 203 forks source link

Permanent false value of durability of retrieving jobs from JobStore #74

Closed arseniZZZ closed 10 years ago

arseniZZZ commented 10 years ago

issue: permanent false value of durability of retrieving jobs from JobStore, value of durability fall into the JobDataMap, and durability had default value(false)

fix: store value of durability from JobStore into appropriate property of JobDetail(not in JobDataMap)

michaelklishin commented 10 years ago

@arseniZZZ please submit a pull request with a fix. Thank you.

jochenberger commented 10 years ago

This breaks loading jobs saved with an earlier version. If "durability" was stored as the string "false" by 1.8.0, loading it with 1.9.0 throws a ClassCastException

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at com.novemberain.quartz.mongodb.MongoDBJobStore.retrieveJob(MongoDBJobStore.java:177) ~[quartz-mongodb-1.9.0.jar:na]
at $JobStore_5367b7187523.retrieveJob(Unknown Source) ~[na:na]
at org.quartz.core.QuartzScheduler.getJobDetail(QuartzScheduler.java:1518) ~[quartz-2.2.1.jar:na]

What about checking if the value is Boolean or String and using Boolean.parseBoolean in the latter case?

michaelklishin commented 10 years ago

@jochenberger sounds acceptable. I'd use Boolean.valueOf, perhaps.