Package org.quartz.impl.jdbcjobstore
Class JobStoreCMT
- java.lang.Object
-
- org.quartz.impl.jdbcjobstore.JobStoreSupport
-
- org.quartz.impl.jdbcjobstore.JobStoreCMT
-
public class JobStoreCMT extends JobStoreSupport
JobStoreCMTis meant to be used in an application-server environment that provides container-managed-transactions. No commit / rollback will be handled by this class.If you need commit / rollback, use
instead.JobStoreTX- Author:
- Jeffrey Wescott, James House, Srinivas Venkatarangaiah
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
JobStoreSupport.RecoverMisfiredJobsResult, JobStoreSupport.TransactionCallback<T>, JobStoreSupport.TransactionValidator<T>, JobStoreSupport.VoidTransactionCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandontSetNonManagedTXConnectionAutoCommitFalseprotected java.lang.StringnonManagedTxDsNameprotected booleansetTxIsolationLevelReadCommitted-
Fields inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
calendarCache, delegateClass, delegateClassName, delegateInitString, dsName, firstCheckIn, instanceId, instanceName, lastCheckin, LOCK_STATE_ACCESS, LOCK_TRIGGER_ACCESS, maxToRecoverAtATime, sigChangeForTxCompletion, tablePrefix, useProperties
-
Fields inherited from interface org.quartz.impl.jdbcjobstore.Constants
ALIAS_COL_NEXT_FIRE_TIME, ALL_GROUPS_PAUSED, COL_BLOB, COL_CALENDAR, COL_CALENDAR_NAME, COL_CHECKIN_INTERVAL, COL_CRON_EXPRESSION, COL_DESCRIPTION, COL_END_TIME, COL_ENTRY_ID, COL_ENTRY_STATE, COL_FIRED_TIME, COL_INSTANCE_NAME, COL_IS_DURABLE, COL_IS_NONCONCURRENT, COL_IS_UPDATE_DATA, COL_IS_VOLATILE, COL_JOB_CLASS, COL_JOB_DATAMAP, COL_JOB_GROUP, COL_JOB_NAME, COL_LAST_CHECKIN_TIME, COL_LOCK_NAME, COL_MISFIRE_INSTRUCTION, COL_NEXT_FIRE_TIME, COL_PREV_FIRE_TIME, COL_PRIORITY, COL_REPEAT_COUNT, COL_REPEAT_INTERVAL, COL_REQUESTS_RECOVERY, COL_SCHED_TIME, COL_SCHEDULER_NAME, COL_START_TIME, COL_TIME_ZONE_ID, COL_TIMES_TRIGGERED, COL_TRIGGER_GROUP, COL_TRIGGER_NAME, COL_TRIGGER_STATE, COL_TRIGGER_TYPE, DEFAULT_TABLE_PREFIX, STATE_ACQUIRED, STATE_BLOCKED, STATE_COMPLETE, STATE_DELETED, STATE_ERROR, STATE_EXECUTING, STATE_MISFIRED, STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_WAITING, TABLE_BLOB_TRIGGERS, TABLE_CALENDARS, TABLE_CRON_TRIGGERS, TABLE_FIRED_TRIGGERS, TABLE_JOB_DETAILS, TABLE_LOCKS, TABLE_PAUSED_TRIGGERS, TABLE_SCHEDULER_STATE, TABLE_SIMPLE_TRIGGERS, TABLE_TRIGGERS, TTYPE_BLOB, TTYPE_CAL_INT, TTYPE_CRON, TTYPE_DAILY_TIME_INT, TTYPE_SIMPLE
-
-
Constructor Summary
Constructors Constructor Description JobStoreCMT()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectexecuteInLock(java.lang.String lockName, JobStoreSupport.TransactionCallback txCallback)Execute the given callback having optionally acquired the given lock.protected java.sql.ConnectiongetNonManagedTXConnection()java.lang.StringgetNonManagedTXDataSource()Get the name of theDataSourcethat should be used for performing database functions.voidinitialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)Called by the QuartzScheduler before theJobStoreis used, in order to give it a chance to initialize.booleanisDontSetNonManagedTXConnectionAutoCommitFalse()booleanisTxIsolationLevelReadCommitted()voidsetDontSetNonManagedTXConnectionAutoCommitFalse(boolean b)Don't call set autocommit(false) on connections obtained from the DataSource.voidsetNonManagedTXDataSource(java.lang.String nonManagedTxDsName)Set the name of theDataSourcethat should be used for performing database functions.voidsetTxIsolationLevelReadCommitted(boolean b)Set the transaction isolation level of DB connections to sequential.voidshutdown()Called by the QuartzScheduler to inform theJobStorethat it should free up all of it's resources because the scheduler is shutting down.-
Methods inherited from class org.quartz.impl.jdbcjobstore.JobStoreSupport
acquireNextTrigger, acquireNextTriggers, calcFailedIfAfter, calendarExists, canUseProperties, checkBlockedState, checkExists, checkExists, checkExists, checkExists, cleanupConnection, clearAllSchedulingData, clearAllSchedulingData, clearAndGetSignalSchedulingChangeOnTxCompletion, closeConnection, clusterCheckIn, clusterRecover, commitConnection, doCheckin, doRecoverMisfires, executeInNonManagedTXLock, executeWithoutLock, findFailedInstances, getAcquireRetryDelay, getAttributeRestoringConnection, getCalendarNames, getCalendarNames, getClassLoadHelper, getClusterCheckinInterval, getConnection, getDataSource, getDbRetryInterval, getDelegate, getDoubleCheckLockMisfireHandler, getDriverDelegateClass, getDriverDelegateInitString, getEstimatedTimeToReleaseAndAcquireTrigger, getFiredTriggerRecordId, getInstanceId, getInstanceName, getJobGroupNames, getJobGroupNames, getJobKeys, getJobNames, getLockHandler, getLog, getMakeThreadsDaemons, getMaxMisfiresToHandleAtATime, getMisfireThreshold, getMisfireTime, getNumberOfCalendars, getNumberOfCalendars, getNumberOfJobs, getNumberOfJobs, getNumberOfTriggers, getNumberOfTriggers, getPausedTriggerGroups, getPausedTriggerGroups, getSelectWithLockSQL, getTablePrefix, getThreadExecutor, getTriggerGroupNames, getTriggerGroupNames, getTriggerKeys, getTriggerNames, getTriggersForJob, getTriggersForJob, getTriggerState, getTriggerState, getUseDBLocks, isAcquireTriggersWithinLock, isClustered, isDontSetAutoCommitFalse, isLockOnInsert, isThreadsInheritInitializersClassLoadContext, isTxIsolationLevelSerializable, jobExists, logWarnIfNonZero, pauseAll, pauseAll, pauseJob, pauseJobs, pauseTrigger, pauseTrigger, pauseTriggerGroup, pauseTriggers, recoverJobs, recoverJobs, recoverMisfiredJobs, releaseAcquiredTrigger, releaseAcquiredTrigger, releaseLock, removeCalendar, removeCalendar, removeJob, removeJob, removeJobs, removeTrigger, removeTrigger, removeTriggers, replaceTrigger, replaceTrigger, resetTriggerFromErrorState, resumeAll, resumeAll, resumeJob, resumeJobs, resumeTrigger, resumeTrigger, resumeTriggerGroup, resumeTriggers, retrieveCalendar, retrieveCalendar, retrieveJob, retrieveJob, retrieveTrigger, retrieveTrigger, retryExecuteInNonManagedTXLock, rollbackConnection, schedulerPaused, schedulerResumed, schedulerStarted, setAcquireTriggersWithinLock, setClusterCheckinInterval, setDataSource, setDbRetryInterval, setDontSetAutoCommitFalse, setDoubleCheckLockMisfireHandler, setDriverDelegateClass, setDriverDelegateInitString, setInstanceId, setInstanceName, setIsClustered, setLockHandler, setLockOnInsert, setMakeThreadsDaemons, setMaxMisfiresToHandleAtATime, setMisfireThreshold, setSelectWithLockSQL, setTablePrefix, setThreadExecutor, setThreadPoolSize, setThreadsInheritInitializersClassLoadContext, setTxIsolationLevelSerializable, setUseDBLocks, setUseProperties, signalSchedulingChangeImmediately, signalSchedulingChangeOnTxCompletion, storeCalendar, storeCalendar, storeJob, storeJob, storeJobAndTrigger, storeJobsAndTriggers, storeTrigger, storeTrigger, supportsPersistence, triggeredJobComplete, triggeredJobComplete, triggerExists, triggerFired, triggersFired, updateMisfiredTrigger
-
-
-
-
Method Detail
-
setNonManagedTXDataSource
public void setNonManagedTXDataSource(java.lang.String nonManagedTxDsName)
Set the name of the
DataSourcethat should be used for performing database functions.
-
getNonManagedTXDataSource
public java.lang.String getNonManagedTXDataSource()
Get the name of the
DataSourcethat should be used for performing database functions.
-
isDontSetNonManagedTXConnectionAutoCommitFalse
public boolean isDontSetNonManagedTXConnectionAutoCommitFalse()
-
setDontSetNonManagedTXConnectionAutoCommitFalse
public void setDontSetNonManagedTXConnectionAutoCommitFalse(boolean b)
Don't call set autocommit(false) on connections obtained from the DataSource. This can be helpful in a few situations, such as if you have a driver that complains if it is called when it is already off.- Parameters:
b-
-
isTxIsolationLevelReadCommitted
public boolean isTxIsolationLevelReadCommitted()
-
setTxIsolationLevelReadCommitted
public void setTxIsolationLevelReadCommitted(boolean b)
Set the transaction isolation level of DB connections to sequential.- Parameters:
b-
-
initialize
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException
Description copied from class:JobStoreSupportCalled by the QuartzScheduler before the
JobStoreis used, in order to give it a chance to initialize.- Specified by:
initializein interfaceJobStore- Overrides:
initializein classJobStoreSupport- Throws:
SchedulerConfigException
-
shutdown
public void shutdown()
Description copied from class:JobStoreSupportCalled by the QuartzScheduler to inform the
JobStorethat it should free up all of it's resources because the scheduler is shutting down.- Specified by:
shutdownin interfaceJobStore- Overrides:
shutdownin classJobStoreSupport
-
getNonManagedTXConnection
protected java.sql.Connection getNonManagedTXConnection() throws JobPersistenceException- Specified by:
getNonManagedTXConnectionin classJobStoreSupport- Throws:
JobPersistenceException
-
executeInLock
protected java.lang.Object executeInLock(java.lang.String lockName, JobStoreSupport.TransactionCallback txCallback) throws JobPersistenceExceptionExecute the given callback having optionally acquired the given lock. Because CMT assumes that the connection is already part of a managed transaction, it does not attempt to commit or rollback the enclosing transaction.- Specified by:
executeInLockin classJobStoreSupport- Parameters:
lockName- The name of the lock to acquire, for example "TRIGGER_ACCESS". If null, then no lock is acquired, but the txCallback is still executed in a transaction.- Throws:
JobPersistenceException- See Also:
JobStoreSupport.executeInNonManagedTXLock(java.lang.String, org.quartz.impl.jdbcjobstore.JobStoreSupport.TransactionCallback, org.quartz.impl.jdbcjobstore.JobStoreSupport.TransactionValidator),JobStoreTX.executeInLock(java.lang.String, org.quartz.impl.jdbcjobstore.JobStoreSupport.TransactionCallback),JobStoreSupport.getNonManagedTXConnection(),JobStoreSupport.getConnection()
-
-