Update TOP of rows with FNH
Is there any way i can run update of specified number of TOP rows:
UPDATE TOP (1) MyTable...
Once i put it into
session.CreateQuery("UPDATE TOP (1) MyTable ...") i get exception
or if i put it into
session.CreateQuery("UPDATE TOP (1) MyTable ...")
.SetFirstResult(0)
.SetMaxResults(1)
It does not pay any effect... still all rows in table being updated...
Thanks for help!
2 Posted by Arkady on 02 Jul, 2010 08:02 AM
Any update on this from support team?
Please give me some tips reagards - how would i do it? Or point to documentation...
Thanks!
Support Staff 3 Posted by James Gregory on 02 Jul, 2010 08:13 AM
Why would you want to do that? NHibernate is for working with entities, not raw SQL. If you want to modify rows in a table, use ADO.
4 Posted by Arkady on 02 Jul, 2010 08:18 AM
Well, main point here - i need to do it in transaction with isolation - other processes with same functionality should not be able to load same row set and update them second time.
May i use entities model with isolation? How?
ADO is fine, but i loose multi - db access feature, which is unacceptable...
Thanks for reply!