Updating entities now depends in the external ids see BT#6369
Commenting debug code.