Cache the Realm instance only after the validation succeeded