public ExecuteJobCommand(long jobDbid) {
this.jobDbid = jobDbid;
}
public Object execute(Environment environment) throws Exception {
Job job = environment.get(JobSession.class).get(jobDbid);
try {
log.fine("executing job "+job+"...");
job.execute(environment);
// if this job is locked too long, it could be unlocked by the lockmonitor and
// executed by another thread.
Date lockExpirationDate = job.getLockExpirationTime();
//can be null if it was rescheduled
if (lockExpirationDate != null) {
long lockExpiration = lockExpirationDate.getTime();
long currentTime = System.currentTimeMillis();
if (currentTime>lockExpiration) {