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

Tilmann Zäschke commented on JDO-760:
-------------------------------------

Thinking about this, returning a {{List}} has two noteworthy implications: 
Lists have random access via {{get()}} and allow reverse traversal via the 
{{ListIterator}}. Both may be problematic for queries with large results, 
because they make it difficult to throw results away once they have been 
traversed. When traversing large result sets with 1 million results or so, 
throwing away 'seen' results is a good policy. An alternative would be to 
implement 'reverse' queries, that would at least allow reverse traversal with 
the {{ListIterator}}, but it seems to be a lot of effort for a feature (reverse 
traversal) that may be rarely used.

Maybe I missed something in the spec, for example, is reverse traversal or 
random access optional behavior?





> Spec update regarding whether Query.execute() returns List or Collection
> ------------------------------------------------------------------------
>
>                 Key: JDO-760
>                 URL: https://issues.apache.org/jira/browse/JDO-760
>             Project: JDO
>          Issue Type: Improvement
>          Components: specification
>    Affects Versions: JDO 3.1
>            Reporter: Tilmann Zäschke
>            Assignee: Tilmann Zäschke
>            Priority: Trivial
>              Labels: documentation
>             Fix For: JDO 3.2
>
>
> The spec says in Section 14.6.1 that Query.execute() returns an unmodifiable 
> {{List}}.
> However, the text in Section 14.3 ('uniquenes'), Section 14.10.2 and all 
> examples in Section 14.10 suggest that a {{Collection}} is returned. I 
> suggest updating the spec to refer to {{List}} in the listed sections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to