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-1054
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0

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

Attach of SCO Collections non-optimal, currently does persist followed by add to collection bypassing SCO

Created: 21/Jun/13 01:11 PM   Updated: 27/Jun/13 04:39 PM   Resolved: 21/Jun/13 08:03 PM
Component/s: Code Structure, Java Types
Affects Version/s: None
Fix Version/s: 3.2.5

 Description  « Hide
When we have something like a Set field and want to attach it, what happens is :
1. SCO is loaded (with current elements)
2. go through current elements comparing with detached elements and delete any no longer needed
3. go through detached elements and attach any are persistable (ec.attachCopy), building up set of required elements
4. add any new elements to the SCO

The problem with this is that any new (not yet persistent) elements will be persisted then added to the SCO, which means any external FK/discrim/order is not present (whereas it would be if going through SCO.add(...))

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 21/Jun/13 08:03 PM
SVN trunk improves this situation