Hi, In addition to my previously posted question http://sqlanywhere-forum.sap.com/questions/11380/nhibernate-issue-with-parameters There seems to be a possible related issue with named query parameters. I have tried very simple query examples with a parameter and the following rig: NHibernate-3.3.0.GA, SybaseSQLAnywhere12Driver, SybaseSQLAnywhere12Dialect, and iAnywhere.Data.SQLAnywhere.v4.0. It is worth noting that this same error also occurs with NHibernate-3.3.0.CR1: NHibernate.Exceptions.GenericADOException was unhandled
Message=could not execute query
[ select fxir.
into #FX_RATE
from FX_RATE fxir
inner join
(select FromCcy, ToCcy, Source, max(effDate) maxEffDate
from FX_RATE
where Status <> 'EXCEPTION'
and EffDate <= ?
and Type = 0
group by FromCcy, ToCcy, Source) C
on C.FromCcy = fxir.FromCcy and
C.ToCcy = fxir.ToCcy and
C.Source = fxir.Source and
C.maxEffDate = fxir.EffDate
where fxir.Type = 0 and
fxir.Status <> 'EXCEPTION' and
fxir.Version = (select max(fx2.Version) from FX_RATE fx2 where fx2.ID = fxir.ID) ]
Positional parameters: #0>5/4/2012 9:10:39 AM
[SQL: select fxir.
into #FX_RATE
from FX_RATE fxir
inner join
(select FromCcy, ToCcy, Source, max(effDate) maxEffDate
from FX_RATE
where Status <> 'EXCEPTION'
and EffDate <= ?
and Type = 0
group by FromCcy, ToCcy, Source) C
on C.FromCcy = fxir.FromCcy and
C.ToCcy = fxir.ToCcy and
C.Source = fxir.Source and
C.maxEffDate = fxir.EffDate
where fxir.Type = 0 and
fxir.Status <> 'EXCEPTION' and
fxir.Version = (select max(fx2.Version) from FX_RATE fx2 where fx2.ID = fxir.ID)]
Source=NHibernate
SqlString=select fxir.*
into #FX_RATE
from FX_RATE fxir
inner join
(select FromCcy, ToCcy, Source, max(effDate) maxEffDate
from FX_RATE
where Status <> 'EXCEPTION'
and EffDate <= ?
and Type = 0
group by FromCcy, ToCcy, Source) C
on C.FromCcy = fxir.FromCcy and
C.ToCcy = fxir.ToCcy and
C.Source = fxir.Source and
C.maxEffDate = fxir.EffDate
where fxir.Type = 0 and
fxir.Status <> 'EXCEPTION' and
fxir.Version = (select max(fx2.Version) from FX_RATE fx2 where fx2.ID = fxir.ID)
StackTrace:
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in C:OpenSourceNHibernate-3.3.0.GA-srcsrcNHibernateLoaderLoader.cs:line 1573
at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) in C:OpenSourceNHibernate-3.3.0.GA-srcsrcNHibernateLoaderLoader.cs:line 1472
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet |
I would disagree that the above is a "simple" example, at least with respect to NHibernate. What problem determination have you done? All of these exceptions appear to be within NHibernate - have you tried to determine what the reason is behind the "cannot execute query" exception in Visual Studio? Does a simpler named query with a single parameter work? Hi Glen. I meant that I have tried simple queries, in addition to the one I have posted. It is defintely not an issue with Visual Studio. And yes, I have tried a painfully simple query, with the same exact result.
(04 May '12, 09:25)
waynemystir
Replies hidden
I didn't mean the problem was with Visual Studio. I meant - have you debugged a simple Criteria query through the VS debugger with a debug build of NH3.3.0?
(04 May '12, 09:34)
Glenn Paulley
Yes, using the simple Criteria query posted in my other question, I followed the entire progression through NH. It does in fact appear to send the query that is logged. I did not do this for the named query issue, as they appear to be closely related and it is rather time consuming.
(04 May '12, 09:38)
waynemystir
However, I should note again that I am new to NH and my debug walk-through may not have revealed a problem there.
(04 May '12, 09:41)
waynemystir
|