[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6597) org.hibernate.session.isDirty() flushes new rows in a Collection which has items mapped with id generator "identity"

Emre BAKKAL (JIRA) noreply at atlassian.com
Tue Aug 23 10:52:03 EDT 2011


org.hibernate.session.isDirty() flushes new rows in a Collection which has items mapped with id generator "identity"
--------------------------------------------------------------------------------------------------------------------

                 Key: HHH-6597
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6597
             Project: Hibernate Core
          Issue Type: Bug
          Components: annotations, core
    Affects Versions: 3.0 final
         Environment: JBoss 5.1, JBoss Seam 2.2.1, Hibernate 3.0, MySql 5.5.11
            Reporter: Emre BAKKAL


If we call org.hibernate.session.isDirty() after we add a new row to a mapped collection in a managed Entity, dirty check forces an id assign and executes an insert.

I see that this behavior is caused because of my collection items having id generator and mapped with cascade type all, but still it's an unexpected behavior. Shouldn't it return true when it found a new row?

I couldn't find a workaround for this behavior. I wanted to give user a choice to save the changes or not, if there are changes which have been made.

Setting FlushMode to NEVER does not help either.

This behavior prevents using this method for change tracking, and is not compatible with the description of the method..

Best Regards..

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list