Hi
When eagerly loading collections using ICriteria, I’ve noticed that some columns sometimes are returned multiple times. I haven’t had a closer look what makes this happen though.
Before digging deeper into this (and creating a JIRA ticket), I just want to check if this is by design (cannot see why, but…)?
Eg, generated sql when using SetFetchMode(“xCollection”, FetchMode.Join)….
Select
this_.Id
[…]
Xcollec2_.Id as Id3_,
Xcollec2_.Id as Id96_0_,
[…]
/Roger
Hmm... Thanks, but… Why?
FYI
There are other situation where data is sent over the wire as multiple, identical columns…
* Bidirectional refs will have two identical columns
* Indexed collections (at least <list>) will have two identical index columns
I’ll be happy to expose these things in some unit tests. Should I do this?
From: nhu...@googlegroups.com
[mailto:nhu...@googlegroups.com] On Behalf Of Ayende Rahien
Sent: den 24 november 2008 12:08
To: nhu...@googlegroups.com
Subject: [nhusers] Re: Duplicated db columns in result set
Once is when it is used as the id of the entity
I understand. But on the other hand – NH knows the column names at run time, doesn’t it? I wouldn’t/can’t argue whether it’s hard or easy to implement, but still… The info is there and it would be _possible_ for NH to know when it’s producing duplicated columns and later reuse the same data eg in bidirectional refs. Or?
Anyhow – now I know it’s not a bug. Thanks.
In normal queries, the network traffic is defiantly neglectable, yes.
I just noticed this today when we were looking at/trying to minimize some big queries for our fat clients where lots of data needs to be transferred over the wire. I’m totally aware there are more “important” stuff to look at than duplicated columns, but I honestly thought it was a bug when I first looked at it.
Thanks for your input.
Should NH be able to sometimes find out from the information that is provided witch columns in the mappings that are identical? This sounds like an optimizing issue.
Should NH be able to sometimes find out from the information that is provided witch columns in the mappings that are identical? This sounds like an optimizing issue.
From: nhu...@googlegroups.com [mailto:nhu...@googlegroups.com] On Behalf Of Ayende Rahien
Sent: 24. november 2008 20:23
I respect that!