[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5740) EXTRA Lazy collection with inverse owner: PersistenSet still contains previosly removed elements

Gail Badner (JIRA) noreply at atlassian.com
Mon Dec 13 14:04:13 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-5740.
------------------------------

    Resolution: Rejected

> EXTRA Lazy collection with inverse owner: PersistenSet still contains previosly removed elements 
> -------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5740
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5740
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0-Final, 3.6.0
>         Environment: Hibernate 3.6.0 (also 3.5.0 is affect of this bug), database indipendent (attached Testcase is based on hsqldb)
>            Reporter: Guenther Demetz
>            Priority: Critical
>         Attachments: TestExtraLazyCollectionWithInverseOwner.jar
>
>
> When mapping a Set with inverse owner (= specifying mappedBy attribute)
> and annotated with
> @org.hibernate.annotations.LazyCollection (LazyCollectionOption.EXTRA)
> then the removal of single elements doesn't work as expected:
> the PersistentSet still contains elements which have previously removed.
> ..
> assertTrue(a.assD.remove(d));    // removing element d from PersistentSet, this assert goes well
> assertFalse(a.assD.contains(d)); // asserting PersistentSet doesn't contain element d anymore, FAILS !!
> The contains method implementation of PersistentSet properly calls flush()
> before executing the select-query, but anyway for some reason the registered DelayedOperation
> (as before enqueued by the remove call) isn't properly brought to execution if the collection is declared with inverse owner.
> This IMHO is a critical bug, as this behavior clearly violates the contracts of method
> java.util.Set#remove(java.lang.Object) where the specifications says:
> <quoted: "the set will not contain the specified element once the call returns">
> Furthermore it could create serious damage to companies using hibernate:
> imagine for example a company cancels a order-position and nevertheless the canceled position is subsequently delivered and invoiced to the customer.
> Please see attached testcase for more details.
> Thanks for attention.

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