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