DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-821
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ludovic Galibert
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

HashSet removeAll() does not remove the elements in the database

Created: 15/Mar/12 10:56 AM   Updated: 30/Mar/12 09:25 AM   Resolved: 17/Mar/12 08:37 AM
Component/s: Persistence
Affects Version/s: 3.0.9
Fix Version/s: 3.0.10, 3.1.0.m2

File Attachments: 1. Zip Archive (3 kB)

Environment: Oracle 11g ( on Windows Server 2008 R2, standard OJDBC driver

Datastore: Oracle
Severity: Development

 Description  « Hide
There is an issue in
When trying to remove a collection from a persistent hashset using removeAll(), the elements are not removed from the join table in the database.

The elements are removed from the delegate at the beginning of the method. However if there is a backing store and a queued update should be performed, each element is checked and backingSuccess is set to true only if the call "contains(element)" returns true. Since useCache=true and isCacheLoaded=true DataNucleus checks if the delegate contains the element but it was removed already earlier so contains() returns false and the elements are not removed from the database.

A simple workaround for this is to iterate over all elements to remove and simply call "remove(element)" but it is not really feasible to enforce this everywhere in an application.

Ludovic Galibert made changes - 15/Mar/12 10:57 AM
Field Original Value New Value
Attachment [ 11607 ]
Andy Jefferson added a comment - 17/Mar/12 08:37 AM
SVN trunk and branches/3.0 pass that

Andy Jefferson made changes - 17/Mar/12 08:37 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.10 [ 11501 ]
Fix Version/s 3.1.0.m2 [ 11506 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 30/Mar/12 09:25 AM
Status Resolved [ 5 ] Closed [ 6 ]