Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC 2.0 querying: orderByAsc/Dsc includes duplicate results

Hi,
I've noticed some very disturbing query behavior as of late. I'm trying to do query result sorting where there is some referenced data I'd potentially like to sort by as well. For example:
query.orderByAsc(MyQueryModel.ROOT.object().referencedObject().attribute())

Despite also including "query.distinct()" I always get a result set that includes duplicates... but ONLY when ordering by a referenced object's attribute. For instance,
query.orderByAsc(MyQueryModel.ROOT.object().attribute())

does NOT include any duplicate results. This applies to multi-dimensional sorts as well. If they are all "first order" attributes then I get the right result set. If I try to order by any "second order" attributes then the result set includes duplicates.

So... what gives? This seems completely broked to me. Anyone know if this is known or if there is something that could be off in our query building?
Thanks!
John

0 votes



2 answers

Permanent link
I've noticed some very disturbing query behavior as of late. I'm
trying to do query result sorting where there is some referenced data
I'd potentially like to sort by as well. For example:
query.orderByAsc(MyQueryModel.ROOT.object().referencedObject().attribute())
Despite also including "query.distinct()" I always get a
result set that includes duplicates... but ONLY when ordering by a
referenced object's attribute. For instance,
query.orderByAsc(MyQueryModel.ROOT.object().attribute())

does NOT include any duplicate results. This applies to
multi-dimensional sorts as well. If they are all "first
order" attributes then I get the right result set. If I try to
order by any "second order" attributes then the result set
includes duplicates.

So... what gives? This seems completely broked to me. Anyone know if
this is known or if there is something that could be off in our query
building?
Thanks!
John

I haven't seen this behavior yet, but I'd suggest you file a defect for
this.

--
Regards,
Patrick
Jazz Work Item Team

0 votes


Permanent link
Querying: OrderByAsc/Dsc returns duplicate results when ordering on
referenced attributes despite using distinct() (99420)

--
Ritchie Schacher
Jazz Server Development

"Patrick Streule" <patrick_streule> wrote in message
news:op.u3ls3214xfsgax@huangshan.local...
I've noticed some very disturbing query behavior as of late. I'm
trying to do query result sorting where there is some referenced data
I'd potentially like to sort by as well. For example:
query.orderByAsc(MyQueryModel.ROOT.object().referencedObject().attribute())
Despite also including "query.distinct()" I always get a
result set that includes duplicates... but ONLY when ordering by a
referenced object's attribute. For instance,
query.orderByAsc(MyQueryModel.ROOT.object().attribute())

does NOT include any duplicate results. This applies to
multi-dimensional sorts as well. If they are all "first
order" attributes then I get the right result set. If I try to
order by any "second order" attributes then the result set
includes duplicates.

So... what gives? This seems completely broked to me. Anyone know if
this is known or if there is something that could be off in our query
building?
Thanks!
John

I haven't seen this behavior yet, but I'd suggest you file a defect for
this.

--
Regards,
Patrick
Jazz Work Item Team

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,939

Question asked: Nov 11 '09, 6:51 p.m.

Question was seen: 6,728 times

Last updated: Nov 11 '09, 6:51 p.m.

Confirmation Cancel Confirm