Hi, I'm using hibernate with ehcache (don't think it matters, tho).. When a user logs in i identify him by his email and i use his email for all subsequent calls. Now, since email is not my "hibernate id" (the one i annotated with @Id) i have to to load it with a query and thus, store it in the query cache. However, when the user logs out i can't explicitly evict him from the cache since he is stored within a region that it shares with others users that have logged in since. My question is.. can i load the user into the 2nd level cache (thus making eviction easier) without going again to the database with the session().get(user) method?
|