// from DriftManagerBean.updateDriftDefinition when creating a definition from a
// pinned template. Because the transaction in which the definition is created has
// not yet been committed when this method is invoked, we cannot look up the
// definition.
MongoDBChangeSet changeSet = changeSetDAO.findOne("id", new ObjectId(changeSetId));
changeSet.setDriftDefinitionId(driftDefId);
changeSet.setResourceId(resourceId);
changeSet.setId(new ObjectId());
changeSetDAO.save(changeSet);
return changeSet.getId();
}