nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

NH-4040 - IStatelessSession.Get() returns proxy when using lazy="no-proxy"

Open nhibernate-bot opened this issue 8 years ago • 0 comments

Alexander Zaytsev created an issue:

On Tuesday, 1 May 2012 02:22:24 UTC+12, Jordan wrote:

Hi all,

I've got a problem doing updates with a stateless session and I'm wondering if anyone has seen something like this. (NHibernate 3.1).

I'm basically doing the following:

SomeEntity e = statelessSession.Get<SomeEntity>(id); 
e.SomeProperty = "a new value"; 
statelessSession.Update(e); 

and I am getting the following error:

NHibernate.MappingException: No persister for: 
Castle.Proxies.SomeEntityProxy 
   at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String 
entityName) 
   at NHibernate.Impl.StatelessSessionImpl.GetEntityPersister(String 
entityName, Object obj) 
   at NHibernate.Impl.StatelessSessionImpl.Update(String entityName, 
Object entity) 
   at NHibernate.Impl.StatelessSessionImpl.Update(Object entity) 

I have stepped through in the debugger and can see that statelessSession.Get<SomeEntity>(id) is returning me a proxy. Is this correct?

regards, Jordan.

nhibernate-bot avatar Oct 12 '17 22:10 nhibernate-bot