[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3871) unnecessary proxy initialization on audit record save

Pavla Nováková (JIRA) noreply at atlassian.com
Tue Apr 21 15:07:17 EDT 2009


unnecessary proxy initialization on audit record save
-----------------------------------------------------

                 Key: HHH-3871
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3871
             Project: Hibernate Core
          Issue Type: Bug
          Components: envers
    Affects Versions: 3.3.1
         Environment: Hibernate 3.3.1, Envers 1.2.0, MySQL 5.1
            Reporter: Pavla Nováková


Let's have unidirectional mapping @ManyToOne from Item to Category. Consider to set dependency from item instance to category proxy: item.setCategory(categoryProxy) and then call entityManager.merge(item). With enabled auditing this causes unneccessary categoryProxy initialization on persisting item audit record. Please see attachment for Item and Category classes, simple Run class code and final sql output if you want to reproduce the issue. Note that both category and item classes uses business key in their equals and hashCode methods. Calling equals method on uninitialized proxy is probably the reason for its initialization.





 

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