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

Eugene Goroschenya (JIRA) noreply at atlassian.com
Sun Sep 13 12:26:50 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33949#action_33949 ] 

Eugene Goroschenya commented on HHH-4437:
-----------------------------------------

I assume "HHH-4437-envers-hibernate-3_3-tests.patch" and "HHH-4437-envers-hibernate-3_3-fix.patch" are also actual for http://anonsvn.jboss.org/repos/hibernate/core/trunk/envers
I have checked it by looking http://anonsvn.jboss.org/repos/hibernate/core/trunk/envers sources but have not checked by applying patches.

> 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
>            Priority: Blocker
>         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