At 11:20 AM 1/31/2002 -0500, you wrote:
> > -----Original Message----- > > From: Juozas Baliuka [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 31, 2002 12:23 PM > > To: Jakarta Commons Developers List > > Subject: RE: Serious problem with MRUMap -- JCS LRU and MRUMap -- RE: > > [simplestore] enhancements (was: [simplestore] inital check in) > > > > <skip> > > >You should try to build it as a memory plugin for JCS. It might require > > >some element attribute additions (what type of reference) if they are > > >useful. > > > > > >The cache hub manages expiration at request time, this could be moved to > > >a background thread. Cleanup of unused items could result in spooling. > > > > Sorry, I can't use any "background cleanup" it has no meaning for memory > > cache. > >Sure it does. > > > This thread can remove objects from cache, but not from memory, if > > application has strong reference on object. > >Yes. It can remove it from the cache. > > > "expiration at request time" has no meaning if application has strong > > reference on object. > > > >It can be removed from the cache. > > > example situation : > > ............................................... > > User u = cache.get(id); > > if( u == null ){ > > u = User.create( id ); > > cache.put(id,u); > > session.setAttribute("user",u);// I have strong reference here > > team.add(u); > > } > > .............................................. > > > > request.setAttribute("player",u); > > > > ............................................... > > > > Requests, operations , but I don't remove "user" from session > > .............................................. > > > > assertTrue("try to increase sessin time out", session.isValid() ); > > // my session is valid at this time. > > // cache must not remove my "user" if GC not decided to do this. > > > > assertEquals("cache doe's not work or bug in GC ", > > session.getAttribute("user"), cache.get(id)); > > > > Cache must release unused references, if memory is "low" and must never > > remove object from cache if it used by application. > > > >Why? Is it a cached store? It can be removed from the store. > >I'm not sure what you are trying to do or why. :) Yes, situation is trivial, but not trivial to understand me. I need this for store close to JDO ideas : Object obj = store.retrieveByID(id); .................................................. Any operations except store.remove(obj) or store.remove(MyClass,id) ; ................................................ if( store.retrieveByID(id) != obj) throw new FatalException("my storage doe's not work"); >Good luck. > > > if this test fails I don't need this kind of cache, it can be very fast, > > but not useful. > > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>