[infinispan-dev] [ISPN-548] Discussion on updating the QueryInterceptor to be able to update old keys

Israel Lacerra israeldl at gmail.com
Thu Jul 22 09:45:44 EDT 2010


Navin,

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.
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.

Anyway, putting the same key twice:

"Key, value pairing is: - test + org.infinispan.query.Pessoa at 2af8f5
Entry is created
Entry is changed
Key, value pairing is: - test + org.infinispan.query.Pessoa at 1088a1b
Entry is changed"

entry.isChanged() is always returning true. But, like I said, maybe it's a
problem with my changes.

I will see it more carefully tomorrow...


Israel

On Thu, Jul 22, 2010 at 10:09 AM, Manik Surtani <manik at jboss.org> wrote:

>
> On 21 Jul 2010, at 12:54, Navin Surtani wrote:
>
> > 1 - User does a put()
> > 2 - Interceptor checks the set of keys used within the same context to
> > see if the same key has been used
> > 3 - If it has an UPDATE is used.
> > 4 - If not we do an ADD.
>
> Sorry, just saw this.  To confirm, this should work even beyond the scope
> of a single invocation, and even a single transaction, correct?  E.g.,:
>
> Tx1:
>        1) creates a NEW entry using cache.put()
>        2) new entry is indexed
>
> Tx2 (potentially at a later date):
>        1) updates the entry using cache.put()
>        2) the index should be updated
>
> 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).
>
> Mircea's solution of testing entry.isCreated() is a valid one.
>
> Cheers
> Manik
>
> --
> Manik Surtani
> manik at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
>
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20100722/e86b8eb9/attachment-0001.html 


More information about the infinispan-dev mailing list