These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Troubles with Asa ADO.Net & NHibernate
PostPosted: Fri Jan 05, 2007 5:23 am 
Newbie

Joined: Tue Dec 27, 2005 5:02 am
Posts: 7
When a invalid SQL Command syntax is executed for a ASA database, no exception is thrown by the AsaClient, instead it returns just a resultset with one row and no columns.

NHibernate then just grabs that and returns a blank object in the GetRow(..) method of the Loader.cs.

If you argue that's a bug in the ado.net driver of asa, I agree. But I would expect that NHibernate would throw an exception if the amount of colums in the resultset == 0.

Any NHibernate Developer want to comment on this behavior?

Regards,

Ward


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 5:27 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
First, I don't believe this can be true - maybe there is some misunderstanding on your part or some syntax error.
Second, even if it was true, you can't really expect NHibernate to check everything everywhere just in case some driver writers didn't read the documentation properly.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 5:39 am 
Newbie

Joined: Tue Dec 27, 2005 5:02 am
Posts: 7
Hi Sergey,

Below the example query generated by NHibernate 1.2.0.2002.

I've executed the first query in the IAnyWhere's version of the Query Analyzer and it failed, because of the quotes and the incorrect owner. I'm not sure at this point if that's an error by NHibernate, but that's a side issue. The issue here is that the ASAClient does not throw an error when there is a syntax error. I'm going to try to reproduce that behavior in a test, I'll let you know..

Regards,

Ward

-------

Query that is generated by NHibernate, and does not work:

SELECT this_."ISBNNumber" as y0_, this_."Title" as y1_, this_."DatePurchased" as y2_, this_."NumberOfPages" as y3_, this_."CategoryID" as y4_, this_."SubCategoryID" as y5_, categories1_."Description" as y6_ FROM [gwtest].[Books] this_ left outer join [gwtest].[Categories] categories1_ on this_."CategoryID"=categories1_."CategoryID" and this_."SubCategoryID"=categories1_."SubCategoryID"


Query that works with ASA:

SELECT this_.ISBNNumber as y0_, this_.Title as y1_, this_.DatePurchased as y2_, this_.NumberOfPages as y3_, this_.CategoryID as y4_, this_.SubCategoryID as y5_, categories1_.Description as y6_ FROM dbo.[Books] this_ left outer join dbo.[Categories] categories1_ on this_.CategoryID=categories1_.CategoryID and this_.SubCategoryID=categories1_.SubCategoryID


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 7:14 am 
Newbie

Joined: Tue Dec 27, 2005 5:02 am
Posts: 7
Further testing pointed out that the query is accepted and correctly executed by the ASAClient.

I'm now stuck by the fact that in the GetRow() the amount of cols there need to be retrieved is determined by the persitsers.length. In my case the persisters array has a length of zero. No clue why.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.