6.8. Detecting Migrations Between Nodes

By default the migration between nodes is transparent to the objects and you should never need to detect it because there can be many reasons why an object is migrated to some node (not only because the object or another one requested it) and because the Core will never tell you the exact reason. The Core provides a generic callback, which is called whenever an object is recreated on a node. The name of the callback is object_updated(). The callback has a single reason parameter that, for the purposes of object migration, is always set to INSTANCE_MIGRATED. INSTANCE_MIGRATED can't be used to detect migration between nodes, because the Core uses this reason also when the object is loaded from the swap file or restored from the archive file. In most cases an application programmer should not care and if the callback is used at all it should be used for debugging purposes only.