On May 19, 2011, at 12:09 PM, Sanne Grinovero wrote:
>> </snip?
>
> How do you do that? Apps don't have any direct access to the Hibernate Cache.
>
>> I assume the keys being used in the 2LC use entity names or class
>> names combined with the primary keys;
>> it's totally possible to have multiple applications using the same
>> entity names, which is quite common in my experience.
>
> That's what region name comes in. Multiple apps shouldn't have the same
region name. That's what discriminates entities in different apps.
ah, thank you I finally understand why the configuration property
hibernate.cache.region_prefix
can be very useful.
Actually, it would be nice to document this explicitly as otherwise
people might end up deserializing a binary stream in the wrong
application..
On the contrary, the thing is that in multi-app environments, i.e. JBoss AS, people
shouldn't fiddle with this cos IIRC, the JPA/Hibernate deployer makes sure that the
region prefix has the correct information about the deployment.
So, better not touch it and let the integration layer do what's best at, integrate
multiple apps in a single environment.
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache