[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-4437) ToOneDelegateSessionImplementor breaks Hibernate.getClass(auditedEntity.proxyOfnotAuditedEntity)

Adam Warski (JIRA) noreply at atlassian.com
Wed Sep 30 12:28:50 EDT 2009


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

Adam Warski resolved HHH-4437.
------------------------------

         Assignee: Adam Warski
       Resolution: Fixed
    Fix Version/s: 3.5

> ToOneDelegateSessionImplementor breaks Hibernate.getClass(auditedEntity.proxyOfnotAuditedEntity)
> ------------------------------------------------------------------------------------------------
>
>                 Key: HHH-4437
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4437
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: envers
>    Affects Versions: 3.3.x
>            Reporter: Eugene Goroschenya
>            Assignee: Adam Warski
>            Priority: Blocker
>             Fix For: 3.5
>
>         Attachments: HHH-4437-envers-hibernate-3_3-fix.patch, HHH-4437-envers-hibernate-3_3-tests.patch
>
>
> Probably there is mistake in changes applied for HHH-4010 that leads to incorrect working of Hibernate.getClass(proxy) method.
> See ToOneDelegateSessionImplementor#doImmediateLoad(String entityName)
>   ...
>   Session session = versionsReader.getSession();
>   return session.get(entityClass, (Serializable) entityId);
>   ...
> It can return proxy but Hibernate SessionImplementor interface says
> /**
> * Load an instance immediately. This method is only called when lazily initializing a proxy.
> * Do not return the proxy.
> */
> public Object immediateLoad(String entityName, Serializable id) throws HibernateException;
> Probably solution is to use delegate.doImmediateLoad(entityClass, (Serializable) entityId) instead of session.get(entityClass, (Serializable) entityId) 

-- 
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