commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juozas Baliuka <>
Subject RE: [simplestore] inital check in
Date Wed, 16 Jan 2002 12:48:43 GMT

>Jep, and I do the same in my app, but a layer lower (_not_ in the cache,
>but in the DB layer, which is the persistency layer I described above).

It may interesting for you if you do the same in your app.

I use cashe this way:

//implementation of StorageCacheHelper not the last implementation, 
synchronized in the last Layer.
// Synchronization Layer implements the same interface.

  Object call(String name, Object args [] ){

  ResultWrapper wrp= null; // need wrapper for result if result is null

  //Cashe implementation wraps java.util.Map interfce, real cashe 
// depends on Map  implementation, and can be reused in any kind of cache , 
it can be HashMap,WeakMap, //SomeMRUMap.

     wrp =  map.get(name, args );
     if(wrp != null) return wrp.result;

   Object result =  myRealStorageLayerImplementsTheSameInterfaceAs_this 
(name, args );
   wrp = new ResultWrapper(result);

   if(procDescriptor(name).flushCache()) {

   map.put( KeyPair(name,args), wrp );

    return  wrp.result;



it is not fragment from real implementation, my real implementation is more 
complex and SQL dependant.
But I have plans to fix it.

> > >Just giving my opinion, as I'm looking for a decent cache
> > for some time
> > >now and I'm considering using simplestore.
> > I can recomend a very special kind of cache "OS Cashe":
> >
> > If you use JSP in youe application.
>Thanks for the tip, I should look into this -- but that is the other
>side (front-end) of the app, while I'm looking for a cache for the
>back-end (persistency layer).
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message