code: @Transactional
  	public int clearDeferredEvents() {
  		Query query = m_entityManager.createNamedQuery("clearDeferredEvents");
  		@SuppressWarnings("unchecked")
  		List<DeferredEvent> result = query.getResultList();
  		int ret = result.size();
  		log.debug("#found {} deferred events",result.size());
  		for (DeferredEvent deferredEvent:result) {
  			log.debug("#deferred pid: {} processName: {} eventType: {} fire: {} now: {} ",deferredEvent.getProcessInstance().getId(), deferredEvent.getProcessDefinitionName(), deferredEvent.getEventType(), deferredEvent.getFire(),new Date().getTime());
  			m_entityManager.remove(deferredEvent);
  		}
  		m_entityManager.flush();
  		return ret;
  	}
docs: /* (non-Javadoc)
  @see nz.co.senanque.workflow.WorkflowDAO#clearDeferredEvents()