Can we change this to behave differently depending on the Dialect/Driver
(not sure where this is defined)?

    Diego


On Mon, Jul 26, 2010 at 19:13, Richard Brown (gmail) <
[email protected]> wrote:

>  Hi Diego,
>
> Yes, the way parameters are generated was changed specifically to handle
> when we have parameters that appear in a projection, and a group-by clause.
>
> So something like:
>
> select @p0 from Foo group by @p0
>
> had to generate only a single parameter, or the database (SQL
> server) complained that the select was not part of the aggregate.
>
>
> I must admit I haven't tried this on Informix though.
>
> Regards,
>     Richard
>
>  *From:* Diego Mijelshon <[email protected]>
> *Sent:* Monday, July 26, 2010 11:04 PM
> *To:* nhibernate-development <[email protected]>
> *Subject:* [nhibernate-development] NH-1981 and databases without named
> parameters
>
> All,
>
> I have a situation here... I've updated the solution to NH 3 without
> running all the persistance tests (my bad), and I've just now found that
> several of them are broken.
> The apparent reason is that NH is no longer repeating parameters when using
> the same name twice in a DB that doesn't support named ones.
>
> Example:
> For the following query:
>   from User where StartDate <= :someDate and ActivationDate <= :someDate
>
> The generated query is roughly (omitting aliases):
>   SELECT the, mapped, fields
>   FROM User
>   WHERE StartDate <= ? AND ActivationDate <= ?
>
> NH 2.1.2 would add the value of the "someDate" parameter twice (although
> I've seen cases where the parameters were in the wrong order).
> NH 3.0.0 is adding it only once, causing a "Wrong number of parameters"
> exception (DB is Informix).
>
> My initial assessment is that the changes in commit 4944 related to NH-1981
> broke this (which I'll try to prove by undoing that changeset and writing a
> small proof-of-concept).
> I'll open a proper JIRA when I get that but, could someone with more
> experience in the codebase check if this is, effectively, a regression?
>
> Richard, I'm particularly interested in your insight :-)
>
> Thanks!
>
>     Diego
>
>

Reply via email to