<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Maybe we could just clarify the javadoc
      of IGNORE_RETURN_VALUES and say that it only applies to write
      operations and is ignored for everything else? Why punish the user
      with an exception when doing a 'get'?<br>
      <br>
      We already document there's a (very common-sense) exception for
      conditional writes were the flag is ignored (ISPN-3141).<br>
      <br>
      On 06/10/2013 12:33 PM, Dan Berindei wrote:<br>
    </div>
    <blockquote
cite="mid:CA+nfvwTcZj=OBp0D6aw4_fBWGs=HkyqzmKmqK_o22Vc8wDphHA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div><br>
            <div class="gmail_extra"><br>
              <br>
              <div class="gmail_quote">On Thu, Jun 6, 2013 at 9:08 PM,
                Ray Tsang <span dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:saturnism@gmail.com" target="_blank">saturnism@gmail.com</a>&gt;</span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div class="im">On Jun 6, 2013, at 13:26, Mircea
                    Markus &lt;<a moz-do-not-send="true"
                      href="mailto:mmarkus@redhat.com">mmarkus@redhat.com</a>&gt;
                    wrote:<br>
                    <br>
                    &gt;<br>
                    &gt; On 4 Jun 2013, at 13:55, Dan Berindei &lt;<a
                      moz-do-not-send="true"
                      href="mailto:dan.berindei@gmail.com">dan.berindei@gmail.com</a>&gt;
                    wrote:<br>
                    &gt;<br>
                    &gt;&gt;&gt;&gt; CacheLoaderInterceptor and
                    DistributionInterceptor both honour the
                    IGNORE_RETURN_VALUES flag for get commands, but I
                    think it would be more useful if they ignored it -
                    just like they ignore it for conditional commands.<br>
                    &gt;&gt;&gt;&gt;<br>
                    &gt;&gt;&gt;&gt; That would make it possible for
                    users to only keep a reference to a
                    cache.getAdvancedCache().withFlags(IGNORE_RETURN_VALUES)
                    and use it for both read and write operations.<br>
                    &gt;&gt;&gt;&gt;<br>
                    &gt;&gt;&gt;&gt; What do you think?<br>
                    &gt;&gt;&gt;<br>
                    &gt;&gt;&gt; If I was to take the role of a
                    colleague of the person who's written the Infinispan
                    code, it'd be very confused to see a cache reference
                    created with IGNORE_RETURN_VALUES being used for a
                    get() operation&#8230; I can see myself thinking: "Why on
                    earth do you call get with IGNORE_RETURN_VALUES?"<br>
                    &gt;&gt;<br>
                    &gt;&gt; Isn't Galder's point not to allow invoking
                    get with IGNORE_RETURN_VALUES? As both of you
                    pointed out, Get + IGNORE_RETURN_VALUES doesn't make
                    any sense :-)<br>
                    &gt;&gt;<br>
                    &gt;&gt;<br>
                    &gt;&gt; You'd think conditional operations with
                    IGNORE_RETURN_VALUES don't make sense either, yet we
                    have a special case to handle those as if the flag
                    wasn't present :)<br>
                    &gt;<br>
                    &gt; I guess you're referring to ISPN-3141?<br>
                  </div>
                </blockquote>
                <div><br>
                </div>
                <div>Exactly. Does it make sense to call
                  cache.withFlags(IGNORE_RETURN_VALUES).putIfAbsent(k,
                  v)? What should it return?<br>
                  <br>
                </div>
                <div>
                  &nbsp;</div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div class="im">
                    &gt; Still I think Get + IGNORE_RETURN_VALUES
                    doesn't make any sense :-)<br>
                    <br>
                  </div>
                  +1. It definitely threw me off...<br>
                  <div class="">
                    <div class="h5"><br>
                    </div>
                  </div>
                </blockquote>
              </div>
              <br>
            </div>
            <div class="gmail_extra">Ok, maybe IGNORE_RETURN_VALUES
              wouldn't be the best flag name for what I had in mind... I
              was thinking of a scenario where the application needs to
              do both reads and writes, but for writes it never needs to
              know the previous value. In that scenario it would make
              sense to call something like <br>
              <br>
              &nbsp;&nbsp;&nbsp; cache =
cacheManager.getCache().getAdvancedCache().withFlags(IGNORE_RETURN_VALUES_ON_WRITES)<br>
              <br>
              at the beginning and only ever use that reference in the
              application. I agree that using the existing
              IGNORE_RETURN_VALUES flag for that would be a bit
              misleading, though.<br>
            </div>
            <div class="gmail_extra"><br>
            </div>
            Should we change anything about the IGNORE_RETURN_VALUES,
            then? I guess it would be relatively simple to make it so
            that get() operations with the flag throw an exception and
            (optionally) put() operations always return null. Should I
            create an issue in JIRA for that?<br>
            <br>
          </div>
          Cheers<br>
        </div>
        Dan<br>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
infinispan-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>