[hibernate-dev] [infinispan-dev] [ISPN-6] (Infinispan cache provider for Hibernate) Remaining TODOs, notes and questions

Galder Zamarreno galder.zamarreno at redhat.com
Tue Aug 4 09:02:06 EDT 2009



On 08/04/2009 11:32 AM, Manik Surtani wrote:
>
> On 4 Aug 2009, at 09:37, Galder Zamarreno wrote:
>
>> Hi,
>>
>> Re: https://jira.jboss.org/jira/browse/ISPN-6
>>
>> Source code for this is currently located in an Infinispan branch in the
>> Hibernate SVN repo:
>>
>> https://svn.jboss.org/repos/hibernate/core/branches/INFINISPAN/
>> http://anonsvn.jboss.org/repos/hibernate/core/branches/INFINISPAN/
>>
>> I've picked this JIRA from Chris Bredesen. I'm waiting to get an answer
>> to an email I sent him yesterday but in the mean time, here's a list of
>> TODOs:
>>
>> 1. Current Infinispan region factory needs to point to a config with
>> named caches. Suggested property name:
>> hibernate.cache.region.ispn4.configs
>
> hibernate.cache.infinispan.cfg ?
>
> - why do we need 'region' in there, non-intuitive to end-users?
> - I'd rather use infinispan rather than ispn.

Ok, fair enough.

>
>>
>> 2. Need a equivalent version of this region factory where cache manager
>> is retrieved from JNDI. Suggsted property name:
>> hibernate.cache.region.ispn4.manager
>
> s/region.ispn4/infinispan

Ok

>
>>
>> 3. Configuration properties for named cache names. Suggested property
>> names:
>> hibernate.cache.region.ispn4.cfg.entity
>> hibernate.cache.region.ispn4.cfg.collection
>> hibernate.cache.region.ispn4.cfg.query
>> hibernate.cache.region.ispn4.cfg.timestamps
>
> s/region.ispn4/infinispan

Ok.

One thing here though. Chris's original solution works in such way that 
for each entity/collection, a new cache is retrieved from the cache 
manager using the region name, so for this example 3 caches would be 
created:

Cache1 for [org.hibernate.test.cache.infinispan.functional.VersionedItem]
Cache2 for [org.hibernate.test.cache.infinispan.functional.Item]
Cache2 for [org.hibernate.test.cache.infinispan.functional.Item.items]

Can we confirm this is the intented way? In 
https://jira.jboss.org/jira/browse/ISPN-6 the following is mentioned:

"Use a separate named cache per entity. This cache would hold entity 
instances as well as collections pertaining to that entity."

So, if that is followed and we bear in mind the above example, there 
should only be 2 cache instances created rather than the current 3.

What is clear is that there's no need for 
hibernate.cache.infinispan.cfg.entity or 
hibernate.cache.region.ispn4.cfg.collection. Simply stick the default 
cache configuration for entity/collections in the default section of 
configuration.

I don't we need hibernate.cache.infinispan.cfg.query and 
hibernate.cache.infinispan.cfg.timestamps either since we can simply 
name the caches with the corresponding region names 
(org.hibernate.cache.UpdateTimestampsCache]and 
org.hibernate.cache.StandardQueryCache) and that's it.

>
>>
>> 4. Resolve TransactionalAccess, ReadOnlyAccess and BaseRegion TODOs.
>>
>> 5. Enhance query results region so that query changes are not propagated
>> if invalidation is used and add query.localonly equivalent property.
>> Suggested name: hibernate.cache.region.ispn4.query.localonly
>>
>
> s/region.ispn4/infinispan

Ok.

>
>> 6. Add more unit tests!
>>
>> 7. Document in wiki.
>
> Good stuff, thanks for taking this on!

You're welcome :)

> - Manik
>
>>
>> Some notes I've made while investigating this:
>>
>> - Whereas with JBC2/3, we had the possibility of a shared cache for all
>> types (entities, collections, query,...etc) and a multiplexed version
>> where each type had a specific cache, in Infinispan, it only makes the
>> latter. Amongst other reasons because we don't have eviction regions any
>> more and so we can't exclude the timestamp modification region as we did
>> in JBC2/3. Overall, having a single option is a good thing from a
>> configuration and usability perspective! Remember how complex eviction
>> region definition could get for entities...
>>
>> Finally, a question to the list, specially for Brian/Steve who worked on
>> the JBC2/3 integration layer:
>>
>> - Do we need a similar timestamp region local cache implementation for
>> an ISPN based cache provider?
>>
>> Cheers,
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Manik Surtani
> manik at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
>
>
>
>
>

-- 
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache



More information about the hibernate-dev mailing list