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
Operations

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(...))

Andy Jefferson added a comment - 21/Jun/13 08:03 PM
SVN trunk improves this situation

Andy Jefferson made changes - 21/Jun/13 08:03 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.5 [ 11963 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 27/Jun/13 04:39 PM
Status Resolved [ 5 ] Closed [ 6 ]