Browse Source

fix

release/10.0
zed 5 years ago
parent
commit
a93d434c36
  1. 2
      fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/DriverDelegate.java
  2. 4
      fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/JobStoreSupport.java
  3. 17
      fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/StdJDBCConstants.java
  4. 19
      fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/StdJDBCDelegate.java

2
fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/DriverDelegate.java

@ -99,6 +99,8 @@ public interface DriverDelegate {
String newState, String oldState1, String oldState2) String newState, String oldState1, String oldState2)
throws SQLException; throws SQLException;
int updateTriggerStatesFromOtherStates(Connection conn, String newState, String oldState1, String oldState2, String oldState3) throws SQLException;
/** /**
* <p> * <p>
* Get the names of all of the triggers that have misfired - according to * Get the names of all of the triggers that have misfired - according to

4
fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/JobStoreSupport.java

@ -861,14 +861,14 @@ public abstract class JobStoreSupport implements JobStore, Constants {
try { try {
// update inconsistent job states // update inconsistent job states
int rows = getDelegate().updateTriggerStatesFromOtherStates(conn, int rows = getDelegate().updateTriggerStatesFromOtherStates(conn,
STATE_WAITING, STATE_ACQUIRED, STATE_BLOCKED); STATE_WAITING, STATE_ACQUIRED, STATE_BLOCKED, STATE_ERROR);
rows += getDelegate().updateTriggerStatesFromOtherStates(conn, rows += getDelegate().updateTriggerStatesFromOtherStates(conn,
STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_PAUSED_BLOCKED); STATE_PAUSED, STATE_PAUSED_BLOCKED, STATE_PAUSED_BLOCKED);
getLog().info( getLog().info(
"Freed " + rows "Freed " + rows
+ " triggers from 'acquired' / 'blocked' state."); + " triggers from 'acquired' / 'blocked' / 'error' state.");
// clean up misfired jobs // clean up misfired jobs
recoverMisfiredJobs(conn, true); recoverMisfiredJobs(conn, true);

17
fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/StdJDBCConstants.java

@ -47,7 +47,7 @@ public interface StdJDBCConstants extends Constants {
String SCHED_NAME_SUBST = "{1}"; String SCHED_NAME_SUBST = "{1}";
// QUERIES // QUERIES
String UPDATE_TRIGGER_STATES_FROM_OTHER_STATES = "UPDATE " String UPDATE_TRIGGER_STATES_FROM_OTHER_2_STATES = "UPDATE "
+ TABLE_PREFIX_SUBST + TABLE_PREFIX_SUBST
+ TABLE_TRIGGERS + TABLE_TRIGGERS
+ " SET " + " SET "
@ -60,6 +60,21 @@ public interface StdJDBCConstants extends Constants {
+ " = ? OR " + " = ? OR "
+ COL_TRIGGER_STATE + " = ?)"; + COL_TRIGGER_STATE + " = ?)";
String UPDATE_TRIGGER_STATES_FROM_OTHER_3_STATES = "UPDATE "
+ TABLE_PREFIX_SUBST
+ TABLE_TRIGGERS
+ " SET "
+ COL_TRIGGER_STATE
+ " = ?"
+ " WHERE "
+ COL_SCHEDULER_NAME
+ " = " + SCHED_NAME_SUBST + " AND ("
+ COL_TRIGGER_STATE
+ " = ? OR "
+ COL_TRIGGER_STATE
+ " = ? OR "
+ COL_TRIGGER_STATE + " = ?)";
String SELECT_MISFIRED_TRIGGERS = "SELECT * FROM " String SELECT_MISFIRED_TRIGGERS = "SELECT * FROM "
+ TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE " + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
+ COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST + COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST

19
fine-quartz/src/com/fr/third/v2/org/quartz/impl/jdbcjobstore/StdJDBCDelegate.java

@ -228,7 +228,7 @@ public class StdJDBCDelegate implements DriverDelegate, StdJDBCConstants {
try { try {
ps = conn ps = conn
.prepareStatement(rtp(UPDATE_TRIGGER_STATES_FROM_OTHER_STATES)); .prepareStatement(rtp(UPDATE_TRIGGER_STATES_FROM_OTHER_2_STATES));
ps.setString(1, newState); ps.setString(1, newState);
ps.setString(2, oldState1); ps.setString(2, oldState1);
ps.setString(3, oldState2); ps.setString(3, oldState2);
@ -238,6 +238,23 @@ public class StdJDBCDelegate implements DriverDelegate, StdJDBCConstants {
} }
} }
@Override
public int updateTriggerStatesFromOtherStates(Connection conn, String newState, String oldState1, String oldState2, String oldState3) throws SQLException {
PreparedStatement ps = null;
try {
ps = conn.prepareStatement(rtp(UPDATE_TRIGGER_STATES_FROM_OTHER_3_STATES));
ps.setString(1, newState);
ps.setString(2, oldState1);
ps.setString(3, oldState2);
ps.setString(4, oldState3);
return ps.executeUpdate();
} finally {
closeStatement(ps);
}
}
/** /**
* <p> * <p>
* Get the names of all of the triggers that have misfired. * Get the names of all of the triggers that have misfired.

Loading…
Cancel
Save