Class ClockworkConflictResolver

java.lang.Object
com.evolveum.midpoint.model.impl.lens.ClockworkConflictResolver

@Component public class ClockworkConflictResolver extends Object
Resolves conflicts occurring during clockwork processing when multiple threads modify the same focus object concurrently. For the feature description, see https://docs.evolveum.com/midpoint/reference/concepts/clockwork/conflict-resolution-howto/. MidPoint uses an optimistic locking strategy when dealing with concurrent focus updates at the clockwork level. This class is responsible for the implementation. The conflict detection is based on comparing object versions. There are two mechanisms employed: - precondition-based detection using VersionPrecondition objects - watching for conflicts using ConflictWatcher objects The former is able to prevent unwanted (concurrent) modifications, because it halts the operation as soon as a conflict is detected, i.e. before the actual focus modification takes place. The latter is used to detect that a conflict happened so we can later act upon it. For some retry actions (namely: recompute, reconcile) we use only the watching approach. See shouldCreatePrecondition(LensContext). See also the docs in the related configuration element (ConflictResolutionType).
  • Constructor Details

    • ClockworkConflictResolver

      public ClockworkConflictResolver()
  • Method Details

    • shouldCreatePrecondition

      public <O extends ObjectType> boolean shouldCreatePrecondition(LensContext<O> context)
    • createConflictWatcherAfterFocusAddition

      public <O extends ObjectType> void createConflictWatcherAfterFocusAddition(LensContext<O> context, String focusOid, String initialFocusVersion)