[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2314) EntityUpdateAction does not do a deepCopy for loadedState, making change detection of Custom Type based on a Collection not working

arnaud.roger@gmail.com (JIRA) noreply at atlassian.com
Tue Dec 19 05:29:06 EST 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2314?page=all ]

arnaud.roger at gmail.com updated HHH-2314:
----------------------------------------

    Attachment: hibernatetestcase.zip

The zip contains an eclips eproject with a TestCase that shows the issue

HibernateTestCase.testCreateUserUpdateRolesBetweenFlushes fail with eclipse 3.2.1 but pass with 3.1.1

> EntityUpdateAction does not do a deepCopy for loadedState, making change detection of Custom Type based on a Collection not working
> -----------------------------------------------------------------------------------------------------------------------------------
>
>          Key: HHH-2314
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2314
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.0.ga, 3.2.1
>  Environment: Hibernate 3.2.1.ga, SQLServer and Oracle 10
>     Reporter: arnaud.roger at gmail.com
>  Attachments: hibernatetestcase.zip
>
>
> We have a User object with a roles HashSet<String> that is map with a CustomType to VARCHAR in the database using a comma separated format.
> When this Entity is manipulated through a long transaction hibernate does not detect that the Entity is dirty and does not flush the change to the database.
> This does not happen in Hibernate 3.1.1
> After tracing through Hibernate I identified the bug. This is due to a change in the 3.2 branch in EntityUpdateAction
> http://fisheye.jboss.org/browse/~br=tag%3Av321/Hibernate/tags/v321/Hibernate3/src/org/hibernate/action/EntityUpdateAction.java?r1=10125&r2=10614
> The deepCopy is done only when hasUpdateGeneratedProperties() is true, which I is not for our User object. So the set is not deepCopy and the lastUpdated array got a reference to the the same set as the user object. 
> Any modification is so done in the lastUpdated and the User entity, making the object non dirty.
> rollbacking to the 3.1.1 version of this file probably fix the issue.
> Regards
> Arnaud
> PS: I'd try to produce a simple test case in the next days

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