Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] PROGRESS: Sv: Re: Value of DiscriminatorValue not persisted

På tirsdag 20. august 2013 kl. 18:10:28, skrev Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>:
På tirsdag 20. august 2013 kl. 17:28:39, skrev Christopher Delahunt <christopher.delahunt@xxxxxxxxxx>:
Hello Andreas,

Can you provide the stack trace from the debugger where you noticed the
  ObjectBuilder.buildRow was called on the EmailPart
ObjectBuilder/Descriptor?  Short of reproducing it locally, that might
show the code path taken and point to how the wrong
objectbuilder/descriptor is getting used.  If you are able to debug
further, I'd go back from that point and see how that ObjectBuilder was
looked up.
 
I think I'm on to something.
 
This is where UnitOfWorkChangeSet.cloneToObjectChangeSet is populated with the wrong ObjectChangeSet:
 
public ObjectChangeSet findOrCreateLocalObjectChangeSet(Object entityClone, ClassDescriptor descriptor, boolean isNew){
    ObjectChangeSet changes = (ObjectChangeSet)this.getObjectChangeSetForClone(entityClone);
    if (changes == null) {
        if (descriptor.isAggregateDescriptor()) {
            changes = new AggregateObjectChangeSet(CacheId.EMPTY, descriptor, entityClone, this, isNew);
        } else {
            changes = new ObjectChangeSet(descriptor.getObjectBuilder().extractPrimaryKeyFromObject(entityClone, session), descriptor, entityClone, this, isNew);
        }
        changes.setIsAggregate(descriptor.isDescriptorTypeAggregate());
        this.addObjectChangeSetForIdentity(changes, entityClone);
    }
    return changes;
}
The value of the descriptor is:
 
RelationalDescriptor(no.officenet.origo.email.domain.model.entities.EmailPart --> [DatabaseTable(origo_email_part)])
 
and not EmailSinglePart as I would expect.
 
I need to figure out why the descriptor sometimes is of the correct type when adding to the same collection (EmailMessage.rootPartList).
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Back to the top