[
https://issues.apache.org/jira/browse/OFBIZ-4341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114561#comment-13114561
]
Martin Kreidenweis commented on OFBIZ-4341:
-------------------------------------------
Hi Dimitri,
your patch causes the public {{Delegator.getFromPrimaryKeyCache()}} method to
return {{GenericValue.NULL_VALUE}}. I don't know if that's a good idea. The
NULL_VALUE looks like an internal thing to me that the cache uses because it
doesn't want to store {{null}} directly. (It would have the same problem that
cache misses and null-hits are harder to distinguish.) So maybe we don't want
to return that value from the Delegator.
But as I can't currently find any other uses of the {{getFromPrimaryKeyCache}}
method in OFBiz code, I guess your patch is fine as well.
Does somebody still know how the {{GenericValue.NULL_VALUE}} was originally
intended to be used?
Martin
> GenericDelegator.findOne cache not working for not-found values (cached
> not-found treated like cache miss)
> ----------------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-4341
> URL: https://issues.apache.org/jira/browse/OFBIZ-4341
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Martin Kreidenweis
> Assignee: Jacques Le Roux
> Attachments: OFBIZ-4341-findOne-cache-fix.patch, OFBIZ-4341.patch
>
>
> {{GenericDelegator.findOne}} doesn't handle the cache consistently.
> When it doesn't find anything, it puts {{GenericValue.NULL_VALUE}} in the
> cache. When trying to read from the cache it uses the
> {{getFromPrimaryKeyCache}} method, which returns null when
> {{GenericValue.NULL_VALUE}} was stored in the cache, just like for cache
> misses. So a not-found value in the cache is treated like a cache miss and
> the cache isn't actually used.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira