// Delay return from a write operation if the observation queue
// is being overloaded. This needs to be done after releasing
// the (outermost) write locks to prevent potential deadlocks.
// See https://issues.apache.org/jira/browse/JCR-2746
if (isOutermostWriteOperation) {
WorkspaceManager manager =
context.getRepositoryContext().getWorkspaceManager();
ObservationDispatcher dispatcher =
manager.getObservationDispatcher(context.getWorkspace().getName());
dispatcher.delayIfEventQueueOverloaded();
}
}
}