schedule the work after transaction

This commit is contained in:
Alex Huang 2011-08-03 16:29:02 -07:00
parent 310f83fe8b
commit 6cfad45f1e
1 changed files with 4 additions and 3 deletions

View File

@ -415,16 +415,17 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
work = new SecurityGroupWorkVO(vmId, null, null, SecurityGroupWorkVO.Step.Scheduled, null);
work = _workDao.persist(work);
if (s_logger.isTraceEnabled()) {
s_logger.trace("Security Group Mgr: created new work item for " + vmId);
s_logger.trace("Security Group Mgr: created new work item for " + vmId + "; id = " + work.getId());
}
}
work.setLogsequenceNumber(log.getLogsequence());
_workDao.update(work.getId(), work);
_executorPool.schedule(new WorkerThread(), delayMs, TimeUnit.MILLISECONDS);
}
txn.commit();
for (Long vmId : affectedVms) {
_executorPool.schedule(new WorkerThread(), delayMs, TimeUnit.MILLISECONDS);
}
} finally {
_workLock.unlock();
if (s_logger.isTraceEnabled()) {