Immutable entities should not have up-to-date checks performed on a flush
-------------------------------------------------------------------------
Key: HHH-6598
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6598
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.7, 4.0.0.CR1, 3.2.5
Reporter: Ian Robertson
Attachments: DirtyCheckTest.java
When session.flush() is called, hibernate needs to scan all entities currently in session
to see which ones are dirty. In some cases, this can become expensive due to the number of
entities, especially since every field of each entity must be inspected. Unfortunately,
while hibernate will avoid persisting changes made to an entity annotated with @Immutable,
it makes the decision to do so only after invoking the getValues() method on
DefaultFlushEntityEventListener (even though this method is invoked *after* making the
call to requiresDirtyCheck(entity)).
I'm attaching a test case which demonstrates this behavior.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira