I took some time to look at the code and SessionDAO is definitely the place
for this.  I'm planning to create a RequestCacheSessionDAO class that does
not use the CacheManager (i'll keep that just for Authentication caching)
and instead use a implementation specific backend storage for the session
data (i.e. MongoDB).

The process will be:

1. Check local cache
2. Check data store, then put in local cache if found.

Now the only part where i need some guidance is how can i safely keep a
local cache.  

My own ThreadLocal is dangerous unless i can know when to clear it before
the thread is returned to the pool (end of the request).  I didn't find a
spot for that.  

I was looking at the ThreadContext, but that is pretty closed and doesn't
offer a way to store arbitrary data there.  It would be perfect tho since
the session.execute(...) would clear it.

Any pointers on this one?  It seems to be my only obstacle at the moment...



--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Cache-called-too-many-times-per-request-tp6851915p6857599.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to