diff --git a/core/com.b2international.snowowl.core/src/com/b2international/snowowl/core/locks/DefaultOperationLockManager.java b/core/com.b2international.snowowl.core/src/com/b2international/snowowl/core/locks/DefaultOperationLockManager.java index 66bc43af3f..cd343f923f 100644 --- a/core/com.b2international.snowowl.core/src/com/b2international/snowowl/core/locks/DefaultOperationLockManager.java +++ b/core/com.b2international.snowowl.core/src/com/b2international/snowowl/core/locks/DefaultOperationLockManager.java @@ -254,7 +254,15 @@ protected void canContextLockTargets(final DatastoreLockContext context, final I if (!isDisposed()) { for (final Lockable newTarget : targets) { for (final IOperationLock existingLock : getExistingLocks()) { - if (existingLock.targetConflicts(newTarget) || !canContextLock(context, existingLock)) { + /* + * Conflicting targets _are_ allowed provided the contexts are nested properly. + * For example, the following sequence is allowed: + * + * - first lock locks all content with description "maintenance" + * - second lock locks a single repository with description "commit", + * parent description "maintenance", same user + */ + if (existingLock.targetConflicts(newTarget) && !canContextLock(context, existingLock)) { alreadyLockedTargets.put(newTarget, existingLock.getContext()); } }