-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 2nd-Level cache region prefix per Session
PostPosted: Fri Oct 29, 2010 6:24 am 
Newbie

Joined: Thu Sep 10, 2009 9:59 am
Posts: 4
We are building a multi-tenant application that uses separate DBs per tenant. We used an AbstractPoolingDataSource for that as described in this post: http://blog.springsource.com/2007/01/23/dynamic-datasource-routing/. With this approach, cache regions of the 2nd-Level-Cache will be shared across tenants, which leads to conflicting cache keys (as the DB-IDs are not unique across all tenant DBs). This is also described in the comments of the post, and there is also a solution which uses a CacheWrapper that modifies the cache keys when entries are written or read from the cache.

This solution would be okay for us, too. But I just wanted to ask, if it's possible to separate the caches more strictly, e.g. a cache region per tenant. Thought about a cache region prefix per tenant, but it seems cache region prefixes can only be set per SessionFactory (but I only have a single SF for all tenants, I'm just switching the DataSource).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.