Fix GuessEntityName

Description

Both SessionFactoryImpl.GuessEntityName and NHibernateUtil.GuessEntityName implementations are broken because, when they are called with a proxy (all objects of lazy classes are proxies) they do not return the proper type name (that of the mapped class, not the proxy). This prevents usage of ISession.Replicate, ISession.SaveOrUpdate, etc, because NHibernate cannot find a persister for the proxy class (MappingException: no persister for xxxxProxy). Instead, both implementations might instead use something like NHibernateProxyHelper.GuessClass(entity).FullName.

Environment

None

Activity

Show:

Alex Zaytsev June 24, 2017 at 5:14 AM

Quote of :

The problem you are having is that the entity instance is a proxy; unwrap the proxy before use StatelessSession.

Alex Zaytsev August 12, 2016 at 4:40 AM

Move unresolved improvements and new features with minor and trivial priorities to 4.2.0

Ricardo Peres November 22, 2014 at 4:49 PM

I think this is safe for the next 4.0.x. branch.

Ricardo Peres November 18, 2014 at 5:46 PM

Won't Fix

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created April 11, 2013 at 1:27 PM
Updated June 24, 2017 at 5:14 AM
Resolved June 24, 2017 at 5:14 AM
Who's Looking?