From: Gregory C. K. <gck...@cs...> - 2004-06-11 17:40:57
|
Hi, I ran into a problem with the GUS object layer yesterday. I'm not sure if this behavior is a bug or intended, so I'd appreciate some input. I pull two objects ($seq1, $seq2) representing the same row out of the database (for example, if I'm iterating through a list of Similarities and if two share a subject sequence, getSequenceObject('subject') will do this). I use $seq1->getChildren() to find a RepeatType (or features, etc.) that points to it, and then I do the same with the other ($seq2->getChildren()). It looks like the second getChildren() leads to an addChild() that goes back and removes the RepeatType from $seq1->{'children'}. So, $seq1->{'children'} looked like this after $seq1->getChildren(): { 'GUS::Model::DoTS::RepeatType' => { 'GUS::Model::DoTS::RepeatType=HASH(0x8b6a110)' => 1 } }; It looks like this after $seq2->getChildren(): { 'GUS::Model::DoTS::RepeatType' => {} }; and $seq1->{'retrievedChildren'} still shows: { 'GUS::Model::DoTS::RepeatType' => 1 }; As a side effect of a second lookup, I seem to have knocked the RepeatType out of a different sequence's list of children, even though the two sequence objects represent the same row. That seems wrong to me, though it might be my punishment for violating an implicit "one row, one object" rule. I seem to be able to get around this with a call to retrieveChildrenFromDB() before a getChildren(), but that's messy and slow. Is this the intended behavior, and if so, what's a better way to deal with it? Gregory Kettler gck...@cs... Preuss Lab, MGCB, University of Chicago |