[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1644) StatefulPersistenceContext.reassociateProxy: incorrect conditon is always false

Gail Badner (JIRA) noreply at atlassian.com
Fri Dec 18 22:34:29 EST 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-1644.
------------------------------

      Assignee: Gail Badner
    Resolution: Duplicate

> StatefulPersistenceContext.reassociateProxy: incorrect conditon is always false
> -------------------------------------------------------------------------------
>
>                 Key: HHH-1644
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1644
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.3
>            Reporter: Michael Kopp
>            Assignee: Gail Badner
>            Priority: Minor
>
> The following code is found in StatefulPersistenceContext. The session of the LazyInitializer will always be different from the this pointer as the this pointer is a different class!!
> 	private void reassociateProxy(LazyInitializer li, HibernateProxy proxy) throws HibernateException {
> 		if ( li.getSession() != this ) {
> 			EntityPersister persister = session.getFactory().getEntityPersister( li.getEntityName() );
> 			EntityKey key = new EntityKey( li.getIdentifier(), persister, session.getEntityMode() );
> 			if ( !proxiesByKey.containsKey(key) ) proxiesByKey.put(key, proxy); // any earlier proxy takes precedence
> 			proxy.getHibernateLazyInitializer().setSession(session);
> 		}
> 	}
> I think it should be: li.getSession() != session

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list