From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-30 16:48:14
|
>Forum1 get cached then accessed multiple times from the cache, while being >accessed, getThreads() method is used. > >At the end, we got a graph of objects and since the cache share the same >reference to the Forum1, it will cache this graph of object, this could lead >to caching the whole DB over the time... This doesn't occur because objects are cached in a "disassmebled" form and anyway the cache has an expiry algorithm. If you configure caching for Forums but not for Threads in the mapping file, forum data will be cached, but never Thread data. >In a multi threaded environement, multiple threads could get a copy from >the cache of the Forum1 object, how to deal with the concurrency access of >non-synchronized collections ? We never retrieve the *actual* cached data, only a clone of it. ie, pulling data out of the cache involves assembling a new object from the disassembled state. Hope that all makes sense. If it doesn't, go check the code in cirrus.hibernate.impl.ClassPersister that should answer your problems.... peace Gavin |