identity is a problem because it "sort of" breaks the concepts of a unit of work. you also loose the ability to batch writes. for client POID either guid.comb or hilo. either one works hilo uses numbers while guids are... unreadable :) but it's a db key so it should make too much of a difference. technically you get fewer writes with guid because there isn't a sequencing table you need to worry about with hilo. but the cost of the sequence table is negligible at best.
On Dec 17, 12:19 pm, Tim Scott <[email protected]> wrote: > If I call Persist and later Commit fails, will the Persist be rolled > back? > > I take it you think identity is bad choice for Ids. I can't say I > disagree. Maybe this is an example of why it's not great. It was the > easiest option. What do you prefer, guid, hi-lo? > > On Dec 17, 11:02 am, Fabio Maulo <[email protected]> wrote: > > > Then you have even another problem: you are using identity > > > On Fri, Dec 17, 2010 at 1:56 PM, Tim Scott > > <[email protected]>wrote: > > > > I answered my own question. The insert does not happen on Save, but > > > later on Commit. Since the Id is gotten from the DB, it is not known > > > until the insert happens. > > > > On Dec 17, 10:41 am, Tim Scott <[email protected]> wrote: > > > > parent.AddChild(transientChid); > > > > session.Save(parent); > > > > > I have the parent mapped to cascade, and it does. But > > > > transientChild.Id is still the transient value (0) after it has been > > > > persisted with the cascade. Is this expected? How do I get the newly > > > > created child's Id? > > > > > By the way, I have two situations like this, one is mapped inverse and > > > > the other is not. Same result in both cases: child Id is transient > > > > value after cascade inserted; > > > > -- > > > 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]<nhusers%[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/nhusers?hl=en. > > > -- > > 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.
