Le 18/03/2015 13:16, Adrian Crum a écrit :
If you code Delegator calls to avoid the cache, then there is no way for a sysadmin to configure the caching behavior - that bit of code will ALWAYS make a database call.

If you make all Delegator calls use the cache, then there is an additional complication that will add a bit more code: the GenericValue instances retrieved from the cache are immutable - if you want to modify them, then you will have to clone them. So, this approach can produce an additional line of code.

I don't see any logical reason why we need to keep a GenericValue came from cache as immutable. In large vision, a developper give information on cache or not only he want force the cache using during his process. As OFBiz manage by default transaction, timezone, locale, auto-matching or others.
The entity engine would be works with admin sys cache tuning.

As example delegator.find("Party", "partyId", partyId) use the default parameter from cache.properties and after the store on a cached GenericValue is a delegator's problem. I see a simple test like that :
if (genericValue came from cache) {
   if (value is already done) {
      getFromDataBase
      update Value
   }
   else refuse (or not I have a doubt :) )
}
store


Nicolas

Reply via email to