Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1899720
  • 博文数量: 606
  • 博客积分: 9991
  • 博客等级: 中将
  • 技术积分: 5725
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-17 19:07
文章分类

全部博文(606)

文章存档

2011年(10)

2010年(67)

2009年(155)

2008年(386)

分类:

2009-01-17 13:23:45

用 Quartz 进行作业调度 使用JDBCJobStore提供的数据持久性时,可以在quartz.properties设置一些参数:例如


org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true

# Using RAMJobStore
## if using RAMJobStore, please be sure that you comment out
## org.quartz.jobStore.tablePrefix, org.quartz.jobStore.driverDelegateClass, org.quartz.jobStore.dataSource
#org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

# Using JobStoreTX
## Be sure to run the appropriate script(under docs/dbTables) first to create database/tables
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

# Configuring JDBCJobStore with the Table Prefix
org.quartz.jobStore.tablePrefix = QRTZ_

# Using DriverDelegate
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate

org.quartz.jobStore.useProperties = true

# Using datasource
org.quartz.jobStore.dataSource = qzDS

# Define the datasource to use
org.quartz.dataSource.qzDS.driver = net.sourceforge.jtds.jdbc.Driver
org.quartz.dataSource.qzDS.URL = jdbc:jtds:sqlserver:
//localhost:1433;DatabaseName=SearchGen

org.quartz.dataSource.qzDS.user = sa
org.quartz.dataSource.qzDS.password = 123456
org.quartz.dataSource.qzDS.maxConnections = 30

其中 org.quartz.threadPool.threadCount = 10表示线程池的线程数是10,所以,每次scheduler.start()时,系统都会启动10个线程,表QRTZ_FIRED_TRIGGERS动态存储启动后正在进行的或即将进行的线程的信息 

可以看到很多重复的状态为EXECUTING的线程,这样的话可能对JOB程序造成一些不可预知的印象,所以,最好在程序把QRTZ_FIRED_TRIGGERS重复的列删掉...

 

阅读(6634) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~