David E Jones wrote:
> On Apr 23, 2010, at 10:37 AM, Adam Heath wrote:
>
>> David E Jones wrote:
>>> For that call the sorting is done in the database (not cached), so there's
>>> probably a difference in databases or database configs.
>> Not entirely accurate. The first match on a condition/entity is
>> cached, as it is returned from the database. If a later call is only
>> different on the ordering, then the system just reorders in memory
>> from the previously cached query.
>
> I don't understand your reply or how it applies to what I wrote. I didn't
> write anything about how sorting in the cache worked, just that it wasn't
> relevant because the call below was not cached. Could you explain?
Maybe this use case below is hitting the in-memory sorting, because
some other part of the code is running the same query, but with a
different ordering key. So the earlier query is database sorted, but
the bug reported below is running a second, identical query, but with
a different ordering. This could happen if you click a column sort.
I'm speaking more general-purpose. Based on your comment, I could see
databases having different handling of null values in sorts. So
ideally, the cache system should handle that case.
And, now that I see it, you're right, the code below is not cached.
So, everything I just wrote doesn't apply to *this* issue. But it
could be some other issue waiting to bite us.
>
> -David
>
>
>>> On Apr 23, 2010, at 8:49 AM, Divesh Dutta wrote:
>>>
>>>> Hello Developers,
>>>>
>>>> I see an strange issue on Release 9.04. But that issue does not exists on
>>>> latest OFBiz trunk. Below is brief description of issue:
>>>>
>>>> 1) When I use any of the method (like findList or findByAnd) of
>>>> DelegatorImpl.java class , and sort it by "sequenceNum", For eg in
>>>> EditProductFeatures.groovy: (Release 9.04)
>>>>
>>>> context.productFeatureAndAppls =
>>>> delegator.findList('ProductFeatureAndAppl',
>>>> EntityCondition.makeCondition([productId : productId]), null,
>>>> ['sequenceNum', 'productFeatureApplTypeId', 'productFeatureTypeId',
>>>> 'description'], null, false);
>>>>
>>>> It returns me the list of values, with *Not-Null values at the top* , and
>>>> then it sort in Ascending order by "sequenceNum", ......
>>>>
>>>> 2) But When I use Latest trunk in OFBiz: Using same example, It returns me
>>>> the list sorted by "sequenceNum", .... in ascending order and then
>>>> *Not-null values at the bottom
>>>>
>>>> *3) I think this is the major bug in Release 9.04, because if we think at
>>>> application level, if a catagory has over 800 products, Catalog Manager
>>>> will have to go to the last page, to sequence every single product for it
>>>> to show properly on the front end.
>>>>
>>>> 4) Instead if Catalog Manager want to sequence the products, he will
>>>> arrange them at very first page.
>>>>
>>>> 5) I tried to found the reason of this major difference, but could not
>>>> locate the exact fix in any of the commit. So I request all the
>>>> developers, if any one have any idea regarding this please share your
>>>> views here. Also I think this should be fixed in Release 9.04 as well.
>>>>
>>>> Thanks
>>>> --
>>>> Divesh Dutta.
>>>>
>