SearchCriteria<VMTemplateStoragePoolVO> sc = updateStateSearch.create();
sc.setParameters("id", templatePool.getId());
sc.setParameters("state", currentState);
sc.setParameters("updatedCount", templatePool.getUpdatedCount());
templatePool.incrUpdatedCount();
UpdateBuilder builder = getUpdateBuilder(vo);
builder.set(vo, "state", nextState);
builder.set(vo, "updated", new Date());