[infinispan-dev] Design change in Infinispan Query

Emmanuel Bernard emmanuel at hibernate.org
Wed Feb 5 11:30:32 EST 2014


On Wed 2014-02-05 15:53, Mircea Markus wrote:
> 
> On Feb 3, 2014, at 9:32 AM, Emmanuel Bernard <emmanuel at hibernate.org> wrote:
> 
> > Sure searching for any cache is useful. What I was advocating is that if you search for more than one cache transparently, then you probably need to CRUD for more than one cache transparently as well. And this is not being discussed. 
> 
> Not sure what you mean by CRUD over multiple caches? ATM one can run a TX over multiple caches, but I think there's something else you have in mind :-)


//some unified query giving me entries pointing by fk copy to bar and
//buz objects. So I need to manually load these references.

//happy emmanuel
Cache unifiedCache = cacheManager.getMotherOfAllCaches();
Bar bar = unifiedCache.get(foo);
Buz buz = unifiedCache.get(baz);

//not so happy emmanuel
Cache fooCache = cacheManager.getCache("foo");
Bar bar = fooCache.get(foo);
Cache bazCache = cacheManager.getCache("baz");
Buz buz = bazCache.put(baz);


> 
> > 
> > I have to admit that having to add a cache name to the stored elements of the index documents makes me a bit sad.
> 
> sad because of the increased index size? 

It makes the index non natural and less reusable using direct Lucene
APIs. But that might be less of a concern for Infinispan.

> 
> > I was already unhappy when I had to do it for class names. Renaming a cache will be a heavy operation too. 
> > Sanne, if we know that we don't share the semi index for different caches, can we avoid the need to store the cache name in each document?


More information about the infinispan-dev mailing list