TProcessID::fUniqueID changes between streaming a object

I have a object with sub objects which contain TRef’s to each other. I have noticed that after writing the object to file and reading it back the corresponding TProcessID::fUniqueID for those objects have changed. This results in my TRef’s having incorrect fUniqueID values and returning NULL. Why would this be happening?

If you use a TRef pointing to a TObject* obj, you should not use the obj->fUniqueID.
See class TRef documentation.

When reading a referenced object, the TProcessID number
is encoded into the fUniqueID.


But I do not want to nor do I use obj->fUniqueID, I was just printing these values to screen for debugging and noticed that they change between writing and reading in the object from file.
My question is why do these numbers change? Should they not remain the same? And how could I fix this?