Take a look to StatelessSession, there us the Insert.
2009/4/15 Fregas
>
> There's save, saveorupdate but no insert.
>
> On Apr 15, 2:38 pm, Fregas wrote:
> > I don't see an insert on an ISession?
> >
> > On Apr 15, 2:34 pm, Stefan Steinegger wrote:
> >
> > > Use session.Insert to make sure th
There's save, saveorupdate but no insert.
On Apr 15, 2:38 pm, Fregas wrote:
> I don't see an insert on an ISession?
>
> On Apr 15, 2:34 pm, Stefan Steinegger wrote:
>
> > Use session.Insert to make sure that NH performs an insert. You'll get
> > an exception if the record would already exist. "
I don't see an insert on an ISession?
On Apr 15, 2:34 pm, Stefan Steinegger 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
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
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"
2009/4/15 Fregas
>
> what would be the proper way to force nhibernate to do an insert on
> every save?
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.
>
>
> Also, is it possibl