<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello Lubomir,</p>
    <p>the message is "<b>java.lang.IllegalStateException: Conflicts
        watchers leaking: reached limit of 10</b>" - with (almost) 100%
      certainty I can say this is not related to the particular code
      snippet, namely with the delta creation.</p>
    <p>What looks suspicious is the fact that you are explicitly
      modifying an object from within object template.</p>
    <p>Maybe you get a cycle (modification-in-modification) there.</p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 28.03.2019 17:32, Lubomir Odlevak
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABppFo4qHp8o4j_Yt4UTtKqcMhgiKz1i-kTnRUg_AFkZXQrONw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div>I have tested the following code snippet and it
                  works in MP 3.7.2. But It seems that doesn't work in
                  MP 3.8, 3.9 . Any suggestions how to fix it ?</div>
                <div><br>
                </div>
                <div><objectTemplate><br>
                </div>
                <div><mapping></div>
                <div>...</div>
                <div>def delta = DeltaBuilder.deltaFor(UserType.class,
midpoint.getPrismContext()).item(UserType.F_DESCRIPTION).add("new_description").asObjectDelta(user.getOid()) 
                                 </div>
                <div>                       
                  midpoint.modifyObject(delta);</div>
                <div>...</div>
                <div></mapping>  <br>
                </div>
                <div></objectTemplate><br>
                </div>
                <div><br>
                </div>
                <div>I have got following error message in mP version
                  3.8, 3.9:</div>
                <div><br>
                </div>
                <div><span
                    style="color:rgb(51,51,51);font-family:"Source
                    Sans Pro","Helvetica
                    Neue",Helvetica,Arial,sans-serif;font-size:14px">om.evolveum.midpoint.util.exception.ExpressionEvaluationException:
com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
                    com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
                    com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
                    com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
                    com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
                    java.lang.IllegalStateException: Conflicts watchers
                    leaking: reached limit of 10:
                    [ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false},
                    ConflictWatcherImpl{oid='cbf2cf23-d027-4eed-8dc8-7a289a15d47d',
                    initialized=true, expectedVersion=194,
                    hasConflict=false, objectDeleted=false}] in (old)
                    expression in mapping in template mapping 'null' in
objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User Template
                    (FTE,OTHER,C,TE)) in (old) expression in mapping in
                    template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (old) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE)) in (new) expression in
                    mapping in template mapping 'null' in
                    objectTemplate:00000000-780b-43cf-8e00-d9889f4ff478(User
                    Template (FTE,OTHER,C,TE))</span>  <br>
                </div>
                <div><br>
                </div>
                <div>Thanks</div>
                <div>Lubomir Odlevak</div>
                <div><br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
  </body>
</html>