This sounds like the offset mapping in memory is somehow out of sync with the file. We've never seen this condition, which is obviously bad. I'm concerned about this and trying to figure out how it could occur. It seems unlikely to have anything in particular to do with BTree or BNodes: those structures are implemented in the same way as other persistent objects. I think, from your other message, that you are looking closely at the packing code, and that seems like a good idea. There was a time when you talked about overriding a '_p_' method. Does the code you are running involve any such low-level modifications? In the current code tree, File.write() ends with self.file.flush() under all conditions. Is that the case in the code you are running? On Aug 14, 2011, at 12:44 PM, David Hess wrote: > Afterwards, the oids seem to be jumbled up in this BTree (at least - maybe elsewhere in the database too). Unpickled Persistent objects are not what they should be - interior BNodes are sometimes application classes and stored values are sometimes BNodes rather than application classes.