I've been looking for this feature for a long time. Many many thanks.
This code:
EntityEntry oldEntry = sessionImpl.PersistenceContext.GetEntry(entity);
if ((oldEntry == null) && (entity is INHibernateProxy))
{
INHibernateProxy proxy = entity as INHibernateProxy;
Object obj = sessionImpl.PersistenceContext.Unproxy(proxy);
oldEntry = sessionImpl.PersistenceContext.GetEntry(obj);
}
Can be simplified as:
EntityEntry oldEntry = sessionImpl.PersistenceContext.GetEntry(sessionImpl.PersistenceContext.Unproxy(entity));
Hello,
today I found this great extension! But it doesn’t work for me... and couldn’t figure it out.
The variable "oldEntry" is null. I’m a total newbie at NHibernate. I use the newest version of HNibernate in my ASP.NET Project.
I use an HttpModule:
private void context_BeginRequest(object sender, EventArgs e)
CurrentSessionContext.Bind(SessionProvider.Instance.GetSession());
private void context_EndRequest(object sender, EventArgs e)
CurrentSessionContext.Unbind(SessionProvider.Instance.GetSession().SessionFactory);
Maybe this is the problem... thx a lot! Stevo
Hi there,
I load an object in a session, then close the session.
after manipulation object in UI, I want to save it if it is dirty.
but with your method I can't do it.
How I can chek dirty in another session?
I have the same problem with OldEntity is null
I think i am in a different session