// rolls back. It's mostly for your own good :)
EOEditingContext newEditingContext = ERXEC.newEditingContext();
try {
ERTag newTag = createTagNamed(newEditingContext, tagName);
newEditingContext.saveChanges();
tag = newTag.localInstanceIn(editingContext);
}
catch (EOGeneralAdaptorException e) {
// We'll assume this was because of a duplicate key exception and just retry the original
// fetch WITHOUT createIfMissing. If that returns a null, then we know it was some other
// crazy exception and just throw it.