Issue Details (XML | Word | Printable)

Key: NUCCORE-256
Type: Task Task
Status: Open Open
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

Add option of detaching wrappers of SCO classes, so allowing change tracking whilst detached

Created: 16/Apr/09 03:06 PM   Updated: 28/Nov/13 03:11 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
The current SCO wrappers don't have a way of marking the owning object as having the particular field as dirty when a mutator method is called.
e.g if we have a Collection field and whilst detached the user calls collection.add(...).

The changes needed are :
Enhancer : jdoMakeDirty - if detached (jdoStateManager == null && jdoDetachedState != null) then update the detached state for that field
Wrapper classes : makeDirty - if no ObjectProvider then call pc.jdoMakeDirty(fieldName).

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 26/May/09 09:10 AM
With SVN trunk at 26/05/2009 the user can use "detachAllOnCommit" and the persistence property "datanucleus.detachAsWrapped" as "true" and will detach wrappers for SCOs. This will then keep track on dirty fields whilst detached (hence the attach can be optimised)

Andy Jefferson added a comment - 28/Nov/13 03:11 PM
Taken from NUCCORE-1025 (dup). "Currently we default to detaching the raw java types for collection/map fields. There is a persistence property to allow detach (under some circumstances) with SCO wrappers for Collection/Map fields. The next logical step is to save a dirty flag when detached (i.e no owner) and allow the re-attach (need a setOwner method on the SCO)". Merged these two issues