openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: EntitymanagerFactoryImpl.getStoreCache(String cacheName) problem
Date Fri, 04 Apr 2008 07:04:20 GMT
That's not a spec API, so we can change it / augment it as we see fit.
I don't see any reason not to just change that code as you described.

-Patrick

On Thu, Apr 3, 2008 at 10:44 AM,  <Frederic_Bellier@capgroup.com> wrote:
>
>  The EntitymanagerFactoryImpl.getStoreCache(String cacheName) . This method
>  calls DataCacheManager.getDataCache(cacheName).
>  I think it should call DataCachemanager.getDataCache(cacheName, true) to
>  make sure if the cache does not exist it will get created. Unless of course
>  this is the behavior specified by JPA spec. This is important becuase
>  otherwise we get StoreCacheImpl reference with a DelegatingDataCache
>  reference with a null cache reference inside.
>
>  An alternative to make this work would be to instanciate all the namedCache
>  at startup - but this does not sound like a good idea to me because noone
>  can know upfront whcih cache will actually be used. The current
>  DataCacheManagerImpl does not suffer from this issue becuase there is only
>  one dataCache.
>  But in the case of a DataCacheManager implementation with multiple named
>  cache - which is what I am implementing now - then this does not work
>  anymore.
>  Moreover, I cannot chnage the behavior of getDataCache(String name) becuase
>  the interface says:
>     /**
>      * Return the named data cache, or null if it does not exist.
>      */
>     public DataCache getDataCache(String name);
>
>
>  Could this code change be made in the future?
>
>  F
>
>



-- 
Patrick Linskey
202 669 5907

Mime
View raw message