-->
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.  [ 2 posts ] 
Author Message
 Post subject: Possible? Modifying CacheKey via Spring Interceptor
PostPosted: Mon Jul 23, 2007 7:30 am 
Newbie

Joined: Mon Jul 23, 2007 6:53 am
Posts: 2
Location: Munich, Germany
hi everyone,

we are currently working on an application which switches the datasource by loging in according to the users organisation.
the switching is done via HotSwappableTargetSource with one sessionfactory and seems to work fine (all sources have same schema).
After all we tried to enable ehcache for hibernate and ran into a small issue.
    1. i try to get com.example.domain.UserEO with id#1 from datasource A

    2. i try to get com.example.domain.UserEO with id#1 from datasourceB

Result: instead of querying the second userEO, ehCache gives me the result from the cache:

Code:
Cache lookup: com.example.domain.UserEOImpl#1
Cache hit: com.example.domain.UserEOImpl#1

[without enabled cache the results come from both datasources...]

so my questions are..

is there any possibillity to modify the cacheKey in order to differ both queries?
is it ok for hibernate to switch between the datasources, or are there some known issues?

i would be grateful for any expiriences or solutions..
thanks in advance!!

elmar

by the way - we are using
hibernate 3.1.3
spring 2.0.2
ehcache 1.2.3


Last edited by eskalith on Tue Jul 24, 2007 9:47 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 9:39 am 
Newbie

Joined: Mon Jul 23, 2007 6:53 am
Posts: 2
Location: Munich, Germany
what do you think - is it possible to use
setCacheRegion via spring interceptor?

so the cache key could be modified according to the used datasource....

good or bad idea?


greets elmar


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

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.