<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yes - please, guys - no System.outs!! &nbsp;Use the logger if you need to.<div><br><div><div>On 22 Jul 2010, at 15:31, Emmanuel Bernard wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'd recommend to also remove the System.outs floating around as well ;)<div><br><div><div>On 22 juil. 2010, at 16:19, Israel Lacerra wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">So, it is not a problem in my code. <br><br>Navin, changing the two ifs (if(entry.isCreated())...if(entry.isChanged()), to if(entry.isCreated())/else my tests works fine.<br><br>thanks!<br>Israel<br><br><div class="gmail_quote">

On Thu, Jul 22, 2010 at 10:58 AM, Manik Surtani <span dir="ltr">&lt;<a href="mailto:manik@jboss.org">manik@jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div style="word-wrap: break-word;">entry.isChanged() returns true if the entry is, well, changed. &nbsp;Changed includes {created, modified, removed}<div><br></div><div>entry.isCreated() only returns true if the entry has just been created in the scope of the invocation.</div>

<div><br></div><div>See the Javadocs for details:</div><div><br></div><div><a href="http://docs.jboss.org/infinispan/4.1/apidocs/org/infinispan/container/entries/CacheEntry.html#isChanged" target="_blank">http://docs.jboss.org/infinispan/4.1/apidocs/org/infinispan/container/entries/CacheEntry.html#isChanged</a>()</div>

<div><a href="http://docs.jboss.org/infinispan/4.1/apidocs/org/infinispan/container/entries/CacheEntry.html#isCreated" target="_blank">http://docs.jboss.org/infinispan/4.1/apidocs/org/infinispan/container/entries/CacheEntry.html#isCreated</a>()</div>

<div><br></div><div>Cheers</div><div>Manik</div><div><div></div><div class="h5"><div><br></div><div><div><div><div>On 22 Jul 2010, at 14:45, Israel Lacerra wrote:</div><br><blockquote type="cite">Navin,<br><br>I update my trunk and I still have a little issue. But, maybe, it's a problem in my code, cause I had to change the order of QueryInterceptor.&nbsp; This line: cache.getAdvancedCache().addInterceptorAfter(inter, LockingInterceptor.class); in QueryHelper did not work for me, because somehow the LockingInterceptor was not in the interceptor chain yet.<br>



<br>Anyway, putting the same key twice:<br><br>"Key, value pairing is: - test + org.infinispan.query.Pessoa@2af8f5<br>Entry is created<br>Entry is changed<br>Key, value pairing is: - test + org.infinispan.query.Pessoa@1088a1b<br>



Entry is changed"<br><br>entry.isChanged() is always returning true. But, like I said, maybe it's a problem with my changes. <br><br>I will see it more carefully tomorrow...<br><br><br>Israel<br><br><div class="gmail_quote">



On Thu, Jul 22, 2010 at 10:09 AM, Manik Surtani <span dir="ltr">&lt;<a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div><br>
On 21 Jul 2010, at 12:54, Navin Surtani wrote:<br>
<br>
</div><div>&gt; 1 - User does a put()<br>
&gt; 2 - Interceptor checks the set of keys used within the same context to<br>
&gt; see if the same key has been used<br>
&gt; 3 - If it has an UPDATE is used.<br>
&gt; 4 - If not we do an ADD.<br>
<br>
</div>Sorry, just saw this. &nbsp;To confirm, this should work even beyond the scope of a single invocation, and even a single transaction, correct? &nbsp;E.g.,:<br>
<br>
Tx1:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;1) creates a NEW entry using cache.put()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;2) new entry is indexed<br>
<br>
Tx2 (potentially at a later date):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;1) updates the entry using cache.put()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;2) the index should be updated<br>
<br>
So to that end, just checking the presence of the entry in the invocation context is not good enough - all it will tell you is whether the entry was touched within the same scope (whether that scope is an invocation or a transaction is irrelevant).<br>




<br>
Mircea's solution of testing entry.isCreated() is a valid one.<br>
<br>
Cheers<br>
Manik<br>
<font color="#888888"><br>
--<br>
Manik Surtani<br>
<a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a><br>
Lead, Infinispan<br>
Lead, JBoss Cache<br>
<a href="http://www.infinispan.org/" target="_blank">http://www.infinispan.org</a><br>
<a href="http://www.jbosscache.org/" target="_blank">http://www.jbosscache.org</a><br>
</font><div><div></div><div><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br>
_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote>

</div><br><div>
<div style="word-wrap: break-word; font-size: 12px;"><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div>

<div><a href="http://www.infinispan.org/" target="_blank">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org/" target="_blank">http://www.jbosscache.org</a></div><div><br></div></div><br><br>
</div>
<br></div></div></div></div></div><br>_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br></blockquote></div><br>
_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div><br></div></div>_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>