openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: StoreCache/DataCache is not null even when DataCache is configured to be inactive
Date Thu, 22 May 2008 12:23:26 GMT

Hi Craig,
> There should not be any reason for the application to know whether a  data
> cache has been set up or not. 

StoreCache is a published/exposed API with methods that allow user to
operate on L2 cache. Hence a user may find it counter-intuitive when s/he
explicitly configures openjpa.DataCache=false but still gets a no-op

This no-op StoreCache also causes the implementation (StoreCacheImpl) to
check whether it has non-null real delegate or not for every method.  

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

The other choice would have been not to instantiate anything at all and
return null. I am trying to find out what is the rationale of a no-op
implementation versus a pure null. 
Is it to save the user from NPE or something else internal to OpenJPA?


View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message