]
Adam Warski resolved HHH-3871.
------------------------------
Resolution: Fixed
Fix Version/s: 3.5
Assignee: Adam Warski
Fixed in trunk
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á
Assignee: Adam Warski
Fix For: 3.5
Attachments: envers-unneccessary-proxy-init.txt
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: