I can do it in a custom generator but I think it has general use that can benefit all NH users. Here why the what I'm proposing is better than the TableHiLoGenerator. 1. It requires less trips to database because next_hi is not done per table, hence more efficient. 2. much less fragmentation in the ids because the session factory will manage the range of keys to be consumed totally. 3. easier to mimic for outside NH for other applications that use the database. 4. works much better for winforms applications.
Also, since the TableHiLoGenerator allows specifying a different max_lo per table then it doesn't guarantee unique id's per database. I looked at the code and found SequenceHiLoGenerator which maybe does what I'm suggesting but I'm not sure. Unfortunately i can't use it with mssql server though. On Tue, Sep 15, 2009 at 11:49 AM, Fabio Maulo <[email protected]> wrote: > 2009/9/15 Delucia <[email protected]> > >> >> This will require a change to the current implementation where the hilo is >> specified per entity mapping and I think it should be specified per session >> factory. >> > > Not, it don't. You can do it in a custom generator. > > -- > 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 -~----------~----~----~----~------~----~------~--~---
