Hey guys, I'm in doubts wheter Nhibernate is the right choice in my
project.

I use a framework created by my company which uses NHibernate for data
accesing and manipulation. That's why I started with NH as well.

Why I'm not sure:
Currently half of the queries is done in a standard way. But the other
half uses sql (ISQLQuery) via CreateSQLQuery.

-----------
Where standard:
 - With every request I add one object to a table ABC.
 - Sometimes I need to load an record with given ID.

-----------
Where sql:
 - I need to download the data in batches. With every request I should
send (e.g.) 1000records from table ABC.
There can be more threads in downloading involved. That's why I first
mark the rows with a unique id
session.CreateSQLQuery("update v set v.batchId = :batchId from ABC v")
and download them
session.CreateQuery("select v from ABC v where v.batchId = :batchId");
This ensures (I hope) that each thread gets its own set of records.

Note that I can not do it via NHibernate - it doesn't have any Update
method for collections, nor there are any HQL for that.

When I'm deleting rows, I don't want to load them all from database to
delete them - it is unnecessary overhead. Futhermore I need to delete
them at once using some condition, not to send 1000 delete requests.

------------
Am I wrong somewhere, or use I Nhibernate on the wrong place?
-- 
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.


Reply via email to