On May 24, 2006, at 2:44 PM, Jesus Cea wrote: > I'm surely missing something important, but why are ghost objects > keept > in the cache?. When we invalidate some objects in the cache, because > they are modified in the storage (in the "commit" or "abort" > calls), why > don't we simply delete them from the cache?. Suppose A is a ghost and that we are loading B, an instance that has a reference to A. When B is loaded, it will contain a reference to a ghost of A. The loader must have a way to find the existing ghost of A so that it will not make another one. For this purpose, the cache must provide access to all of this connection's persistent instances referenced from anywhere in this process. It would be a bad thing to have two ghosts of the same instance. > > With current approach, "connection.get_cache_count()" is not > representative of real cached objects (and RAM usage), since it counts > also ghost objects that must be fetched from server if touched. That's right.