Alright, figured out the problem...
int result = session.Delete ("from Person p where p.Code=?",
"ABC", NHibernateUtil.String);
It uses un-named parameters...
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike
On Thu, Jun 25, 2009 at 2:49 PM, FrederikGheysels <
[email protected]> wrote:
>
> I've placed a new file here:
>
> http://users.pandora.be/fgzone/testcase.rar
>
> On 25 jun, 13:17, Tuna Toksoz <[email protected]> wrote:
> > The file is corrupt.
> >
> > Tuna Toksöz
> > Eternal sunshine of the open source mind.
> >
> >
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
> >
> > On Thu, Jun 25, 2009 at 2:05 PM, FrederikGheysels <
> >
> >
> >
> > [email protected]> wrote:
> >
> > > Ok, I've created one, it can be found here:
> >
> > >http://users.pandora.be/fgzone/testcase.zip
> >
> > > On 25 jun, 11:57, Tuna Toksoz <[email protected]> wrote:
> > > > Can you create a test case? with mappings, and code?
> >
> > > > Tuna Toksöz
> > > > Eternal sunshine of the open source mind.
> >
> > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt.
> ..
> >
> > > > On Thu, Jun 25, 2009 at 12:33 PM, FrederikGheysels <
> >
> > > > [email protected]> wrote:
> >
> > > > > Hi,
> >
> > > > > I'm migrating my application from NHibernate 2.0 to NHibernate 2.1
> > > > > (beta) (There are some features in it, and I want to use them
> already
> > > > > etc... ).
> >
> > > > > Now, everything works fine: the application compiles, it runs ,
> > > > > etc... However, I have unit-tests that fail, and those failing
> tests,
> > > > > all fail on a Delete query.
> >
> > > > > This is an example of a line of code where NHibernate crashes on:
> >
> > > > > session.Delete ("from Prestation p where p.Code = :p_code",
> someCode,
> > > > > NHibernatUtil.String);
> >
> > > > > When this line is executed, a NullReferenceException is thrown, and
> > > > > the stacktrace looks like this:
> >
> > > > > bij NHibernate.Loader.Loader.DoList(ISessionImplementor session,
> > > > > QueryParameters queryParameters)
> > > > > bij
> > > > > NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor
> > > > > session, QueryParameters queryParameters)
> > > > > bij NHibernate.Loader.Loader.List(ISessionImplementor
> session,
> > > > > QueryParameters queryParameters, ISet`1 querySpaces, IType[]
> > > > > resultTypes)
> > > > > bij NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List
> > > > > (ISessionImplementor session, QueryParameters queryParameters)
> > > > > bij NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List
> > > > > (ISessionImplementor session, QueryParameters queryParameters)
> > > > > bij
> > > NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters
> > > > > queryParameters, ISessionImplementor session, IList results)
> > > > > bij NHibernate.Impl.SessionImpl.List(String query,
> > > QueryParameters
> > > > > queryParameters, IList results)
> > > > > bij NHibernate.Impl.SessionImpl.List(String query,
> > > QueryParameters
> > > > > parameters)
> > > > > bij NHibernate.Impl.SessionImpl.Find(String query, Object[]
> > > values,
> > > > > IType[] types)
> > > > > bij NHibernate.Impl.SessionImpl.Delete(String query,
> Object[]
> > > > > values,
> > > > > IType[] types)
> > > > > bij NHibernate.Impl.SessionImpl.Delete(String query, Object
> > > value,
> > > > > IType type)
> > > > > --NullReferenceException
> > > > > bij
> NHibernate.Param.NamedParameterSpecification.Bind(IDbCommand
> > > > > statement, QueryParameters qp, ISessionImplementor session, Int32
> > > > > position)
> > > > > bij
> > > NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.BindParameterValues
> > > > > (IDbCommand statement, QueryParameters queryParameters, Int32
> > > > > startIndex, ISessionImplementor session)
> > > > > bij
> NHibernate.Loader.Loader.PrepareQueryCommand(QueryParameters
> > > > > queryParameters, Boolean scroll, ISessionImplementor session)
> > > > > bij NHibernate.Loader.Loader.DoQuery(ISessionImplementor
> > > session,
> > > > > QueryParameters queryParameters, Boolean returnProxies)
> > > > > bij
> > > NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections
> > > > > (ISessionImplementor session, QueryParameters queryParameters,
> Boolean
> > > > > returnProxies)
> > > > > bij NHibernate.Loader.Loader.DoList(ISessionImplementor
> session,
> > > > > QueryParameters queryParameters)
> >
> > > > > I don't see where the problem is; this worked fine while using
> > > > > NH2.0 .... Did i forget something ?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---