Concerning the locking, this is not something you must do to get
NHibernate to work correctly, since it already does that. Only if you
implement the HiLo alg. in some other software will you (of course)
need to think about this locking.

/Oskar


2009/8/20 Tuna Toksoz <[email protected]>:
> You can mimic what NH Hilo Generator does.
> In application level:
> -You lock the table that holds the Hi part, fetch and increment
> -In your application, you hold Low, and access to that field/method should
> be serialzied
> -using the formula in the blogpost you can construct the final id.
> In dba level, you're forgiving one of its benefits: decreased locks on db.
> However it is still possible, what you sohuld do is you should also store
> the low part on db.
>
>
> Tuna Toksöz
> Eternal sunshine of the open source mind.
>
> http://devlicio.us/blogs/tuna_toksoz
> http://tunatoksoz.com
> http://twitter.com/tehlike
>
>
>
>
> On Thu, Aug 20, 2009 at 8:41 PM, Cesar Sanz <[email protected]>
> wrote:
>>
>> Sorry but I did not understand.
>>
>> Do I need to run some script against my database?
>>
>> or where Do I enable that?
>>
>> ----- Original Message -----
>> From: Fabio Maulo
>> To: [email protected]
>> Sent: Thursday, August 20, 2009 11:36 AM
>> Subject: [nhusers] Re: HiLo example
>> with (updlock, rowlock)
>>
>> 2009/8/20 Cesar Sanz <[email protected]>
>>>
>>> Hi, from a post I extracted this
>>>
>>> "... A HiLo id has 2 parts as the name suggests they are Hi and Lo. Each
>>> session factory gets the Hi value from database (with locking enabled),
>>> and
>>> lo values are managed by the session factory on its own. .. "
>>>
>>>
>>>
>>> "Each session factory gets the Hi value from database (with locking
>>> enabled), "
>>>
>>>
>>>
>>> How do I enable lock for my database???
>>>
>>>
>>>
>>>
>>>
>>> ----- Original Message -----
>>> From: "Jason Meckley" <[email protected]>
>>> To: "nhusers" <[email protected]>
>>> Sent: Thursday, August 20, 2009 10:03 AM
>>> Subject: [nhusers] Re: HiLo example
>>>
>>>
>>>
>>> Ok so my understanding of HiLo is way off :)
>>>
>>> In response to
>>> 1. Yes, the DD is the integration point. It's terrible, but a reality.
>>> 2. I thought I read that HiLo is not a good choice if you are
>>> providing NH with the connection manually.
>>>
>>> On Aug 20, 10:53 am, "Cesar Sanz" <[email protected]> wrote:
>>> > Oh.. thanks, good article..
>>> >
>>> > ----- Original Message -----
>>> > From: Sidar Ok
>>> > To: [email protected]
>>> > Sent: Thursday, August 20, 2009 1:42 AM
>>> > Subject: [nhusers] Re: HiLo example
>>> >
>>> >
>>> > http://fabiomaulo.blogspot.com/2009/02/nh210-generators-behavior-expl...
>>> >
>>> > On Wed, Aug 19, 2009 at 11:58 PM, spiralni <[email protected]>
>>> > wrote:
>>> >
>>> > Hello,
>>> >
>>> > I am studying the HiLo POID, but no working example is shown.
>>> >
>>> > - Can somebody show me how to use the HiLo?
>>> > - Where can I find examples of this?
>>> > - Can it be used with MsSQL2005?
>>> > - When must I to use this strategy?
>>> >
>>> > Best regards.
>>> >
>>> > --
>>> > Sidar Ok
>>> >
>>> > http://www.sidarok.com
>>> > http://www.twitter.com/sidarok
>>>
>>>
>>>
>>
>>
>>
>> --
>> Fabio Maulo
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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