Well, not having a session reference in your entities would be a good start.
If you like that kind of pattern, I recommend you use Castle ActiveRecord
instead of implementing it yourself.
On a different note, this list is only for development OF NHibernate. Try
nhusers (or StackOverflow) for usage questions.
Diego
On Wed, Feb 8, 2012 at 06:09, pvginkel <[email protected]> wrote:
> I have a virtual method on my Entity base class which calls
> session.SaveOrUpdate. When the entity has lazy fields, the
> DefaultDynamicLazyFieldInterceptor calls the virtual method with the
> TargetInstance and not the info.Target. This means that SaveOrUpdate
> fails with a NonUniqueObjectException because I'm not passing the
> proxy to SaveOrUpdate.
>
> Is this behavior correct? If so, is there a way around this?
>