semaifour / myschedule

Automatically exported from code.google.com/p/myschedule
0 stars 1 forks source link

JdbcSchedulerHistoryPlugin & H2 DB connection problem #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. configure myschedule-2.4.2, h2-1.3.166, quartz.properties generically. 
2. create/start scheduler
3. monitor job history

What is the expected output? What do you see instead?

expecting triggerFired/triggerComplete for JobHistoryRemovalJob, receiving 
triggerFired/triggerMisfired/ScheduleError instead.

Please use labels and text to provide additional information.

quartz.properties is as follows:

org.quartz.scheduler.skipUpdateCheck = true
org.quartz.scheduler.instanceName = QuartzScheduler
org.quartz.scheduler.jobFactory.class = org.quartz.simpl.SimpleJobFactory
org.quartz.scheduler.instanceId = NON_CLUSTERED
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = 
org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.dataSource = quartzDataSource
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5

# JobStore: JDBC jobStoreTX
org.quartz.dataSource.quartzDataSource.driver = org.h2.Driver
org.quartz.dataSource.quartzDataSource.URL = jdbc:h2:~/test
org.quartz.dataSource.quartzDataSource.user = sa
org.quartz.dataSource.quartzDataSource.password =
org.quartz.dataSource.quartzDataSource.maxConnections = 9

# Jdbc Scheduler History Plugin
org.quartz.plugin.MyJobHistoryPlugin.class = 
myschedule.quartz.extra.JdbcSchedulerHistoryPlugin
org.quartz.plugin.MyJobHistoryPlugin.insertSql = INSERT INTO 
qrtz_scheduler_history VALUES(?,?,?,?,?,?,?,?,?,?,?)
org.quartz.plugin.MyJobHistoryPlugin.querySql = SELECT * FROM 
qrtz_scheduler_history ORDER BY event_time DESC
org.quartz.plugin.MyJobHistoryPlugin.deleteSql = DELETE qrtz_scheduler_history 
WHERE event_time < ?
org.quartz.plugin.MyJobHistoryPlugin.deleteIntervalInSecs = 604800
org.quartz.plugin.MyJobHistoryPlugin.dataSourceName = quartzDataSource
org.quartz.plugin.MyJobHistoryPlugin.schedulerContextKey = 
JdbcSchedulerHistoryPlugin.Instance

tomcat 7 logs the attached:

Thanks for the great tool, btw!

John

Original issue reported on code.google.com by uove...@gmail.com on 31 May 2012 at 7:49

Attachments:

GoogleCodeExporter commented 9 years ago
Hi John, thanks for reporting this bug. Yes I see a obvious mistake of not 
setting the SQL param when deleting old histories. I will try to put out a fix 
soon.

Original comment by saltnlight5 on 1 Jun 2012 at 2:31

GoogleCodeExporter commented 9 years ago
John, can you plz give the latest myschedule-quartz-extra-2.4.3-SNAPSHOT.2.jar 
a try?

Original comment by saltnlight5 on 1 Jun 2012 at 3:46

GoogleCodeExporter commented 9 years ago
Hi Zemian,

Good news - immediate problem is solved - thanks!

Do you have any thoughts/ideas why this job might continue to throw 
triggerMisfired events?

I've attached some job/trigger details.

Good progress - thanks for your help!

John

Original comment by uove...@gmail.com on 1 Jun 2012 at 5:29

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision fef0c9103db8.

Original comment by saltnlight5 on 1 Jun 2012 at 11:22

GoogleCodeExporter commented 9 years ago
John,

Are you saying the "JobHistoryRemovalJob" itself is misfiring? The repeat 
interval you set is large enough, so it shouldn't be. Can you print the logger 
output text when this job is misfired? Can you verify the 
"JobHistoryRemovalJob" and it's trigger is indead properly scheduled?

Original comment by saltnlight5 on 1 Jun 2012 at 5:02

GoogleCodeExporter commented 9 years ago
Ah, I think I see the problem. I have set the start datetime of this 
JobHistoryRemovalJob in the past instead of future date. I need to negate this.

I will give you another snapshot.3 to try.

Original comment by saltnlight5 on 1 Jun 2012 at 5:38

GoogleCodeExporter commented 9 years ago
Hi Zemian,

This looks great - thanks for the wonderful help!

Please close out this issue - a super job!

John

Original comment by uove...@gmail.com on 2 Jun 2012 at 6:11

GoogleCodeExporter commented 9 years ago
No problem. Glad it works out for you. I will make these into a release soon. 
Thanks for verifying.

Original comment by saltnlight5 on 2 Jun 2012 at 3:35