Views: 9.3K
Replies: 1
Archived
|
What is the use of the Hi/Lo method in NHibernate?Hello NHibernate gurus. I have worked with NHibernate for a relavitely short time and have a question.
My understanding is that Hi/Lo is used to generate auto-increment numbers for primary keys. But I cannot think of a real-world situation where you would need this. Why not just rely on the underlying database identity or autonumber facilities? And, does this not interfere with the database generated autonumbers (Identities)? Thanks. Craig Johnston, Mar 09, 2011
|
|
Reply 1The primary use that I can think of when using hi/lo is in a disconnected state. Meaning a client can request a hi number and then generate as many lo numbers as it needs when disconnected.
There is also a performance gain, basically it's less chatter between the client and the database. See post here -> http://nhforge.org/blogs/nhibernate/archive/2009/03/20/nhibernate-poid-generators-revealed.aspx Robert Blixt, Mar 09, 2011
|