Login  Register

[jira] [Commented] (OFBIZ-4341) GenericDelegator.findOne cache not working for not-found values (cached not-found treated like cache miss)

Posted by Nicolas Malin (Jira) on Sep 26, 2011; 11:47am
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-4341-GenericDelegator-findOne-cache-not-working-for-not-found-values-cached-not-f-tp3672398p3843491.html


    [ https://issues.apache.org/jira/browse/OFBIZ-4341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114609#comment-13114609 ]

Dimitri Unruh commented on OFBIZ-4341:
--------------------------------------

Martin,

I know what you mean :)

So, it could be dangarous to change the Delegator.getFromPrimaryKeyCache() (for custom modifications), but anyway in my opinion the current implementation is wrong.
If _GenericValue.NULL_VALUE_ is in the cacht, i will get it...



> 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