[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5908) unnecessary updates when using select-before-update dirty check with entity that has immutable many-to-one properties.

Howard Kelsey (JIRA) noreply at atlassian.com
Wed Feb 9 07:04:05 EST 2011


unnecessary updates when using select-before-update dirty check with entity that has immutable many-to-one properties.
----------------------------------------------------------------------------------------------------------------------

                 Key: HHH-5908
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5908
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.1, 3.6.0
            Reporter: Howard Kelsey
            Priority: Critical
         Attachments: update-testcase.zip

Entities with many-to-one properties that have insert="false" update="false" are always marked as dirty! This is because when creating the sqlSnapshotSelectString in AbstractEntityPersister.getPropertyUpdateability() is used to identify which properties should be returned in that select and immutable many-to-one props are not. The AbstractEntityPersister.findModified(Object[] old, Object[] current, Object entity, SessionImplementor session) is used to work out if the object has in fact changed, however AbstractEntityPersister.propertyColumnUpdateable is always used to determine which properties are to be checked which means that immutable many-to-one properties are checked even though they're not returned by snapshot select. This is a side effect of the change made for HHH-2350 which changed ManyToOne.isAlwaysDirtyChecked to always return true. So I think it should be changed so that when comparing with the DB snapshot only the properties returned by the AbstractEntityPersister.sqlSnapshotSelectString should be checked by using AbstractEntityPersister.getPropertyUpdateability() instead of AbstractEntityPersister.propertyColumnUpdateable

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