Markus> Yes I've done all that and it didn't worked, that's why I
assumed it was not compatible.

Oskar > Ha, I haven't tried that, however if that's the case, then I
can't use hilo, because my requirement is to keep identity clause on
all of the tables, i'm afraid I don't have choice here.

On 9 avr, 14:00, Oskar Berggren <[email protected]> wrote:
> It's also necessary to remove the identity clause from the primary key
> columns of the tables where hilo will be used, right?
>
> /Oskar
>
> 2009/4/9 Markus Zywitza <[email protected]>
>
> > The text says:
> >  hilo
>
> > uses a hi/lo algorithm to efficiently generate identifiers of type long,
> > short or int, given a table and column (by default hibernate_unique_keyand
> > next_hi respectively) as a source of hi values. The hi/lo algorithm
> > generates identifiers that are unique only for a particular database.
>
> >  Create that table with the single column and NH, HiLo and MSSQL2005 will
> > be friends.
>
> > -Markus
> > 2009/4/9 graphicsxp <[email protected]>
>
> >> Thanks for the links.
>
> >> I had already looked at all that, but it appears that there's no
> >> solutions for people using MS SQLServer + identity fields.  The help
> >> doesn't go through batch INSERT issue when using identity. The only
> >> generator I seem to be able to use is 'native'.
>
> >> I was hoping someone would have solved that issue.
>
> >> On 9 avr, 11:53, Markus Zywitza <[email protected]> wrote:
> >> >http://www.google.com/search?hl=de&q=nhibernate+hilo+hibernate_unique.
> >> ..
>
> >> > Try the first two results.
>
> >> > -Markus
>
> >> > 2009/4/9 graphicsxp <[email protected]>
>
> >> > > Ok, I've tried
>
> >> > > <id name="Id" column="CommentID">
> >> > >      <generator class="hilo"/>
> >> > >    </id>
>
> >> > > But I get the exception Invalid object name 'hibernate_unique_key'.  I
> >> > > believe I can't use this generator with MS SQLServer 2005.  Any other
> >> > > suggestions ?
>
> >> > > On 9 avr, 11:45, Darius Damalakas <[email protected]> wrote:
> >> > > > why not switch to primary key generation strategy HiLo? or
> >> SequenceHiLo?
>
> >> > > > then you would get Id, and there would be minimal trips to database
>
> >> > > > 2009/4/9 graphicsxp <[email protected]>:
>
> >> > > > > Hi,
>
> >> > > > > If I have an entity which holds a collection and I add 200
> >> entities to
> >> > > > > that collection, when I save it generates 200 INSERT's and it
> >> doesn't
> >> > > > > batch them. I know this is because my tables have an identity
> >> field
> >> > > > > and NH needs to do a select SCOPE_IDENTITY() after each INSERT.
> >> > > > > However, since I really don't care getting the ID after inserting
> >> my
> >> > > > > entities (the children that is), is there a way to force NH to do
> >> it
> >> > > > > in a batch and tell it not to do the extra SELECT ?
>
> >> > > > > Thanks
>
> >> > > > --
> >> > > > Darius Damalakas
--~--~---------~--~----~------------~-------~--~----~
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