1. Hm... At least in 2.1.0. is doesn't, as I see. What I can use as
alternative? session.Merge?
2. If SaveOrUpdateCopy is deprecated, how I can get oldValues if
PreUpdateListener?
3. It works, but doesn't trigger PreUpdateListener. So I must look for
one more detour :(

On 17 Лис, 14:45, Fabio Maulo <[email protected]> wrote:
> 1. SaveOrUpdateCopy is obsolete
> 2. and that is the final thing to do ?
>
> 2009/11/17 Sigma <[email protected]>
>
>
>
> > There is some kind of detour, but, may be, there is more accurate
> > solution?
>
> > using (var session = _sessionFactory.OpenSession())
> > using (var transaction = session.BeginTransaction())
> > {
> >         var saved = session.SaveOrUpdateCopy(entity) as EntityBase;
> >        session.Flush();
> >        if(saved.Version==entity.Version) // seems like hack. Do not upgrade
> > version if it's already upgraded
> >        {
> >                session.Lock(saved,LockMode.Force); // tnx to Ayende blog
> >        }
> >        transaction.Commit();
> >        return saved;
> > }
>
> > --
>
> > 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=.
>
> --
> 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=.


Reply via email to