[nhusers] Re: Hilo Step by Step

2010-04-03 Thread Visar Uruqi
Guys thank you, I understand know the wisdom behind the Hilo I'm OK with Hilo now, I forgot the multi user issue and the traffic thing that's why I tried to save the wasted range's. Visar On Apr 3, 2:41 pm, Jason Dentler wrote: > There is no problem so big it can't be solved with a Guid. > > As

Re: [nhusers] Re: Hilo Step by Step

2010-04-03 Thread Jason Dentler
There is no problem so big it can't be solved with a Guid. As Diego said, if you must use an integer Id and HiLo won't suit your needs, identity is your only option. Please understand identity is not the best practice here. It changes (breaks, IMHO) NH behavior in subtle ways that most beginners d

Re: [nhusers] Re: Hilo Step by Step

2010-04-03 Thread Diego Mijelshon
Visar, HiLo is not magic. The assertion "Whenever the counter reaches max_lo, it fetches a new Hi value from the DB." applies to a LIVE APPLICATION INSTANCE / SessionFactory. The first time an id needs to be generated in a session factory, a new Hi value is fetched. Also, read Tuna's post. If you

Re: [nhusers] Re: Hilo Step by Step

2010-04-03 Thread Tuna Toksoz
why do you care about id's being wasted? This is the purpose of HiLo, reducing id traffic. If there was a way to preserve counter, it would be to store it in DB everytime it is incremented, which is not what we want Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tu

[nhusers] Re: Hilo Step by Step

2010-04-03 Thread Visar Uruqi
Hello Diego Thank you very much for your detailed explanation I did some tests and found out many things about the hilo implementation in nhibernate, I have a question regarding the lo value the so called "counter" You said "Whenever the counter reaches max_lo, it fetches a new Hi value from the

Re: [nhusers] Re: Hilo Step by Step

2010-03-31 Thread Diego Mijelshon
Read the post carefully. The second formula is how to determine the value to insert as the initial "next_hi" when migrating from identity. You can see exactly how the IDs are generated here: https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate/Id/TableHiLoGener

Re: [nhusers] Re: Hilo Step by Step

2010-03-31 Thread Fabio Maulo
2010/3/31 Visar Uruqi > > Is it true that all numbers might get exhausted? > > Yes is true! as with any Int32 or Int64. -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhus...@googlegroups.com.

[nhusers] Re: Hilo Step by Step

2010-03-31 Thread Visar Uruqi
Thank you very much Diego for your reply. I found the following formulas in this link http://stackoverflow.com/questions/1390078/is-there-a-practical-way-of-migrating-from-identity-columns-to-hilo-keys hilo-id = high-value * max_lo + low-value high-value = ceiling(current-identity / max-lo) Can