openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: StoreCache/DataCache is not null even when DataCache is configured to be inactive
Date Wed, 21 May 2008 22:20:21 GMT
Hi Pinaki,

On May 21, 2008, at 3:08 PM, Pinaki Poddar wrote:

>
> The following configuration
>
>    <property name="openjpa.DataCache" value="false"/>
>
> is expected to configure the environment without a DataCache/ 
> StoreCache. Is
> that right expectation?
>
> However, OpenJPAEntityManagerFactory configured as above fails  
> following
> assertions:
>
> 1:  assertNull(emf.getStoreCache());
> 2:  assertNull(emf.getConfiguration().getDataCacheManagerInstance());
>
> but succeeds the following:
>
> 3:  assertNull(((StoreCacheImpl)emf.getStoreCache()).getDelegate());
> 4.
> assertNull 
> (emf 
> .getConfiguration 
> ().getDataCacheManagerInstance().getSystemDataCache());
>
>
> Anyone to shed light why StoreCache or DataCacheManager is  
> instantiated even
> when DataCache is set to be false?

The reason for instantiating DataCacheManager is so applications don't  
have to explicitly test for it in order to use it.

There should not be any reason for the application to know whether a  
data cache has been set up or not. There is no user-visible behavior  
(see other thread) based on whether there is a data cache or not.

So if the openjpa.DataCache is set to "false", a data cache that  
doesn't do anything is instantiated.

Craig
>
>
> -- 
> View this message in context: http://www.nabble.com/StoreCache-DataCache-is-not-null-even-when-DataCache-is-configured-to-be-inactive-tp17380291p17380291.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message