Fixed relationship locking
This commit is contained in:
parent
ce253b5ade
commit
7d4bb76475
|
@ -323,7 +323,9 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
rel.setTargetID(targetId);
|
rel.setTargetID(targetId);
|
||||||
rel.setTargetUCD(targetUCD);
|
rel.setTargetUCD(targetUCD);
|
||||||
|
|
||||||
return onUpdate(toUpdate.addRelation(rel));
|
|
||||||
|
toUpdate =onUpdate(toUpdate.addRelation(rel));
|
||||||
|
return unlockAndUpdate(toUpdate);
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
log.error("Unexpected exception ",t);
|
log.error("Unexpected exception ",t);
|
||||||
unlock(toUpdate);
|
unlock(toUpdate);
|
||||||
|
@ -346,7 +348,7 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
// update only if something changed
|
// update only if something changed
|
||||||
if(toUpdate.getRelationships().size()!=beforeSize) return onUpdate(toUpdate);
|
if(toUpdate.getRelationships().size()!=beforeSize) return onUpdate(toUpdate);
|
||||||
}
|
}
|
||||||
return toUpdate;
|
return unlockAndUpdate(toUpdate);
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
log.error("Unexpected exception ",t);
|
log.error("Unexpected exception ",t);
|
||||||
unlock(toUpdate);
|
unlock(toUpdate);
|
||||||
|
|
Loading…
Reference in New Issue