JobStoreCMT class that delegates to a Spring-managed
DataSource instead of using a Quartz-managed JDBC connection pool.
This JobStore will be used if SchedulerFactoryBean's "dataSource" property is set.
You may also configure it explicitly, possibly as a custom subclass of this
LocalDataSourceJobStore or as an equivalent JobStoreCMT variant.
Supports both transactional and non-transactional DataSource access. With a non-XA DataSource and local Spring transactions, a single DataSource argument is sufficient. In case of an XA DataSource and global JTA transactions, SchedulerFactoryBean's "nonTransactionalDataSource" property should be set, passing in a non-XA DataSource that will not participate in global transactions.
Operations performed by this JobStore will properly participate in any kind of Spring-managed transaction, as it uses Spring's DataSourceUtils connection handling methods that are aware of a current transaction.
Note that all Quartz Scheduler operations that affect the persistent job store should usually be performed within active transactions, as they assume to get proper locks etc.
SchedulerFactoryBean#setDataSource, SchedulerFactoryBean#setNonTransactionalDataSource, SchedulerFactoryBean#getConfigTimeDataSource(), SchedulerFactoryBean#getConfigTimeNonTransactionalDataSource(), org.springframework.jdbc.datasource.DataSourceUtils#doGetConnection , org.springframework.jdbc.datasource.DataSourceUtils#releaseConnection
| Modifier and Type | Field and Description |
|---|---|
| private DataSource | |
| public static final String | NON_TX_DATA_SOURCE_PREFIX
Name used for the non-transactional ConnectionProvider for Quartz. |
| public static final String | TX_DATA_SOURCE_PREFIX
Name used for the transactional ConnectionProvider for Quartz. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void |
| dataSource | back to summary |
|---|---|
| private DataSource dataSource
| |
| NON_TX_DATA_SOURCE_PREFIX | back to summary |
|---|---|
| public static final String NON_TX_DATA_SOURCE_PREFIX Name used for the non-transactional ConnectionProvider for Quartz. This provider will delegate to the local Spring-managed DataSource. | |
| TX_DATA_SOURCE_PREFIX | back to summary |
|---|---|
| public static final String TX_DATA_SOURCE_PREFIX Name used for the transactional ConnectionProvider for Quartz. This provider will delegate to the local Spring-managed DataSource. | |
| LocalDataSourceJobStore | back to summary |
|---|---|
| public LocalDataSourceJobStore() | |
| closeConnection | back to summary |
|---|---|
protected void closeConnection(Connection con)
| |
| initialize | back to summary |
|---|---|
public void initialize(org.
| |