Issue Details (XML | Word | Printable)

Key: NUCCORE-940
Type: Bug Bug
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

Update of embedded when using pessimistic txns can result in problem in dirty field handling

Created: 23/Oct/12 01:03 PM   Updated: 23/Oct/12 01:03 PM
Component/s: Persistence
Affects Version/s: 3.0.11, 3.1.0.release
Fix Version/s: None


 Description  « Hide
Consider

class A
{
    B b;
}
class B
{
    C c;
}
class C
{
    String field1;
    String field2;
}
and a.b, and b.c are embedded.

We do the following updates

a.b.c.field1=newVal1;
a.b.c.field2=newVal2;

The first update will call SM.setXXXField. This calls SM.replaceField(pc, field, value, makeDirty) and cascades up to its owner. This then calls ec.makeDirty(a) followed by ec.makeDirty(c), and the second call triggers flushInternal in ObjectManagerImpl (due to reaching the limit of dirty objects). At this point the only object dirty in the ObjectManagerImpl is A. The call to ec.makeDirty(c) then completes marking it as dirty.

The second update then calls ec.makeDirty(a) which again triggers flushInternal. The dirty flag on the "c" hasn't yet been updated so anything in a store plugin relying on that information will fail.

This has likely been the situation since day 1 of supporting embedded objects

Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.