Issue Details (XML | Word | Printable)

Key: NUCDBFO-24
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Roel Stolker
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store DB4O (ARCHIVED)

SCO wrapped fields are persisted sometimes

Created: 20/Aug/08 03:48 PM   Updated: 09/Sep/08 10:53 AM
Component/s: None
Affects Version/s: 1.0.0.m4
Fix Version/s: None

File Attachments: 1. Zip Archive Test.zip (161 kB)


Datastore: DB4O


 Description  « Hide
Happens when nesting objects of the same type in an Hashtable. For example;

We have an A object with an children Hashtable containing two other A objects:

A
|
children - A
                  |
                  children

                - A
                   |
                   children

A a = new A();
A child1 = new A();
A child2 = new A();
a.addChild(child1);
a.addChild(child2);


After persisting "a" to the datastore we give "child2" a child:

A
|
children - A
                  |
                  children

                - A
                   |
                   children - A
                                     |
                                     children

child2_1 = new A();
child2.addChild(child2_1);


So now there's a child on the second level. We persist this again to update the changes.


Looking at the datastore some new objects of the following types are added:
org.datanucleus.sco.simple.Hashtable
org.datanucleus.identity.DatastoreUniqueOID

It also appears that there are 6 A objects instead of 4. I think this is because DB4O persists the A objects with SCO fields as new objects. Also when reading back the first A object the A object "child2_1" is missing.

Looking at updateObject in DB4OPersistenceHandler it seems that the call to replaceAllLoadedSCOFieldsWithValues does not unwrap the SCO fields on the second level.
 

Sort Order: Ascending order - Click to sort in descending order
Roel Stolker made changes - 20/Aug/08 03:50 PM
Field Original Value New Value
Attachment Test.zip [ 10780 ]
Roel Stolker made changes - 09/Sep/08 10:50 AM
Comment [ I was not correct about the statemanager. It seems that the field jdoDetachedState of a PC is the problem.

This field is also persisted and contains an DatastoreUniqueOID object. ]