ahhh, I was looking at the HashtableCache, which is not thread safe, but I guess all production grade caches are. And, the cache concurrency strategy needs a hard lock because it does multiple operations on the cache and needs to be assured that no other thread has modified the cache. Makes sense. Thanks. Aaron
On Sat, Dec 11, 2010 at 5:56 AM, Fabio Maulo <[email protected]> wrote: > "The underlying cache may not be thread safe" ? > a cache system no thread safe ? > > On Fri, Dec 10, 2010 at 10:51 PM, Aaron Boxer <[email protected]> wrote: >> >> I mean a hard lock. The underlying cache may not be thread safe, so I >> was expecting there to be >> some form of Monitor surrounding any Put or Get on the cache. >> >> Something like: >> >> lock (QueryCache) >> { >> SessionFactoryImpl.getQueryCache(Region).Put(...) >> >> } >> >> lock (QueryCache) >> { >> SessionFactoryImpl.getQueryCache(Region).Get(..) >> >> } >> >> >> The read write concurrency strategy has two hard locks, on global >> lock, and one per key lock. >> >> >> Thanks, >> Aaron >> >> >> >> >> On Fri, Dec 10, 2010 at 5:45 PM, Fabio Maulo <[email protected]> wrote: >> > exactly to lock what, in the query cache ? >> > Ids ? >> > values of projections ? >> > >> > On Fri, Dec 10, 2010 at 6:41 PM, Aaron Boxer <[email protected]> wrote: >> >> >> >> Hello, >> >> >> >> I am looking into the caching code, and I can't see any locking >> >> to prevent multiple sessions from concurrently accessing the query >> >> cache. >> >> >> >> The L2 entity cache does have locking through the cache concurrency >> >> strategy, but not the query cache. >> >> >> >> Any insight would be greatly appreciated, >> >> >> >> Aaron >> > >> > >> > >> > -- >> > Fabio Maulo >> > >> > > > > > -- > Fabio Maulo > >
