An entity with a lazy property cannot be saved in new session

Description

An entity with a lazy property cannot be loaded from one session and saved from another.
This is because the entity is a proxy object, but it is not an INHibernateProxy. Therefore, when it is attached to the new session NHibernate reads it's type as the Proxy type and it can't find the appropriate persister.
The attached patch fixes this by using NHibernateProxyHelpter.GuessClass instead of just running GetType on the entity.

I have only tested this with the Castle ByteCode, it may not be an issue for the others.

Environment

None

Attachments

1

Activity

Fabio Maulo 
July 30, 2011 at 2:10 PM

Closed after final release of NH3.2.0GA

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created March 19, 2011 at 5:41 PM
Updated July 30, 2011 at 2:10 PM
Resolved March 21, 2011 at 7:10 AM
Who's Looking?