Using Persistent JobStores

In many ways, JobStores that use memory for storage and those that use some form of long-term persistence share similar traits. This shouldn't be that surprising because they both serve the same purpose.

As with RAMJobStore, persistent JobStores have both advantages and disadvantages. You should be careful to understand the pros and cons before choosing a persistent JobStore. This section explains the differences and the circumstances under which you would want to use a persistent JobStore.

Currently, Quartz provides two types of persistent JobStores, each one unique in its persistence mechanism.

Persistent JobStores = JDBC + Relational Database

Although several different persistence mechanisms can used to persist Scheduler information for Quartz, Quartz relies on a relational database-management system (RDMS) for persistent storage. If you want to use something other than a database for persistent storage, you must build it yourself by implementing the JobStore interface. Suppose that you wanted to use the file system for persistent storage. You could create a class that implements the JobStore interface. In this chapter, when we say "persistent," we are implicitly talking about using JDBC to persist Scheduler state into the database.

All the persistent JobStores that ship with Quartz extend the org.quartz.impl.jdbcjobstore.JobStoreSupport class.

The JobStoreSupport Class

The JobStoreSupport class is abstract and implements the JobStore interface, discussed earlier in the chapter. It provides base functionality for all JDBC-based JobStores. Figure 6.1 shows the type hierarchy for JobStores.

Figure 6.1. The JobStore type hierarchy

As Figure 6.1 illustrates, JobStoreSupport implements the JobStore interface and acts as a base class for the two concrete persistent JobStores that Quartz offers.

JobStoreSupport Should Have Been Named JDBCJobStoreSupport

A better name for this class would have been JDBCJobStoreSupport because this class is specifically designed to work with JDBC-based storage solutions. However, the name doesn't detract from the functionality that it provides for persistent JobStores.

Because the JobStoreSupport class is abstract, Quartz offers two different types of concrete persistent JobStores, each one designed for a specific database environment and configuration:

  • org.quartz.impl.jdbcjobstore.JobStoreTX
  • org.quartz.impl.jdbcjobstore.JobStoreCMT

Both persistent JobStores are discussed shortly. For now, let's talk about the database that is required for both versions.


Scheduling in the Enterprise

Getting Started with Quartz

Hello, Quartz

Scheduling Jobs

Cron Triggers and More

JobStores and Persistence

Implementing Quartz Listeners

Using Quartz Plug-Ins

Using Quartz Remotely

Using Quartz with J2EE

Clustering Quartz

Quartz Cookbook

Quartz and Web Applications

Using Quartz with Workflow

Appendix A. Quartz Configuration Reference



Quartz Job Scheduling Framework(c) Building Open Source Enterprise Applications
Quartz Job Scheduling Framework: Building Open Source Enterprise Applications
ISBN: 0131886703
EAN: 2147483647
Year: N/A
Pages: 148

Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net