[jira] [Commented] (OFBIZ-10579) Date filtered queries with caching should be restricted to cache

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-10579) Date filtered queries with caching should be restricted to cache

Nicolas Malin (Jira)

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

Gil Portenseigne commented on OFBIZ-10579:
------------------------------------------

Hello [~suraj.khurana], [~mthl],
{quote}Instead of warning that the wrong thing was done, shouldn't we do the right thing meaning not putting the query in the cache
{quote}
Actually ‘EntityQuery’ implement the following behavior in its ::query method :
 * makeWhereCondition(useCache) provide:

{code:java}
// we don't use the useCache field here because not all queries will actually use the cache, e.g. findCountByCondition never uses the cache
 if (filterByDate && !usingCache) {
     if (whereEntityCondition != null) {
         return EntityCondition.makeCondition(whereEntityCondition, this.makeDateCondition());
     } else {
         return this.makeDateCondition();
     }
 }{code}
When using filterByDate with no cache, it's good we use the date condition
 * query then provide

{code:java}
 if (filterByDate && useCache) {
     return EntityUtil.filterByCondition(result, this.makeDateCondition());
 }{code}
When filterByDate with cache enable, the condition wasn't used, but is applied to the result gathered from cache.

 

I do not understand why it is removed in the patch ? Was it not sufficient in the way it was implemented ?

> Date filtered queries with caching should be restricted to cache
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-10579
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10579
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL APPLICATIONS
>    Affects Versions: Upcoming Branch
>            Reporter: Suraj Khurana
>            Assignee: Suraj Khurana
>            Priority: Major
>         Attachments: OFBIZ-10579.patch, OFBIZ-10579.patch
>
>
> As per discussion on Dev ML 
> https://markmail.org/thread/3qnkihmsyhly3lsg



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)