Description
I now and then encounter entries in the relationship tables for List fields (id, element, ordr) non-unique entries for id, ordr. (Two elements are placed on the same index in the same list). I am not sure how to reproduce this, but I do have a question regarding the code in StoreCollectionFieldStrategy.load():
ChangeTracker ct = null;
if (field.getTypeCode() == JavaTypes.ARRAY)
coll = new ArrayList();
else
// load values
Result res = union.execute(store, fetch);
try {
int seq = 0;
while (res.next())
if (ct != null && field.getOrderColumn() != null)
ct.setNextSequence(seq + 1);
} finally
If I am not mistaken, this initializes the changetracker for list fields for persistent objects loaded from the database with an empty list attribute (res.next() = false) with order number of "1", whereas objects with non-empty List fields which are persisted start with an order number of "0". Could this be the reason that I now and then encounter duplicate entries in the relationship table with ordernr "1"? Actually this is also the reason why encounter duplicates for other numbers, since order number is zero based (next sequence number is initialized to size()), but as described, some lists start counting from "1".
kind regards,
Christiaan