Take a look to StatelessSession, there us the Insert. 2009/4/15 Fregas <fre...@gmail.com>
> > There's save, saveorupdate but no insert. > > On Apr 15, 2:38 pm, Fregas <fre...@gmail.com> wrote: > > I don't see an insert on an ISession? > > > > On Apr 15, 2:34 pm, Stefan Steinegger <stefan....@bluewin.ch> wrote: > > > > > Use session.Insert to make sure that NH performs an insert. You'll get > > > an exception if the record would already exist. "An Insert with every > > > save": you should create a new instance in memory for every Insert in > > > the database. NH tries to do in the DB exactly what you are doing in > > > memory. > > > > > Probably the mutable="false" attribute on the class mapping is used to > > > avoid updates. Not sure about that. > > > > > We have properties with empty setters just to make NH happy: > > > > > public string Calculated > > > { > > > get { return Calculation(); } > > > private set { /* only used for persistence */ } > > > > > } > > > > > On Apr 15, 8:22 pm, Fregas <fre...@gmail.com> wrote: > > > > > > What i'm trying to do is make it so that it will always do an insert, > > > > NOT an update even if the object was already retrieved from the db. > > > > This is for logging/auditing. > > > > > > > Flush or you can better try Persist method (don't go to DB is you > don't > > > > > really need it). > > > > > If your case is a special "bulk" operation you should use > StatelessSession. > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---