8 – Why is my update request correct for the database but not for my Drupal interface?

I have 2 custom content entities created with Drupal Console (Drupal generates: entity: content): "person" and "member".
They are related (1 member <-> n people) by a field named 'member_id' in & # 39; person & # 39;
If a person is defined with & # 39; iscontact & # 39; = true, other people related to the same member must have & # 39; iscontact & # 39; = false.

In the PersonForm.php, I have this code for thet:

public function save (array $ form, FormStateInterface $ form_state) {
$ entity = $ this-> entity;

if ($ entity-> get (& # 39; iscontact & # 39;)) {

$ member_id = $ entity-> get ('member_id') -> getString ();
$ iId = $ entity-> get (<id> -> getString ();
$ database =  Drupal :: database ();
$ query = $ database-> select ("person," & ap;);
$ query-> fields (& # 39; ap & # 39; ['id', 'member_id'])
-> condition (& # 39; id, $ iId, & # 39; <& # 39;)
-> condition (& # 39; member_id & # 39 ;, $ member_id, & # 39; = & # 39;);
$ results = $ query-> execute ();

foreach ($ results as $ key => $ result) {
$ numberofrowsaffected = $ database-> update (& # 39; person & # 39;)
-> fields (['iscontact' => 0,])
-> condition (& # 39; id, #, result -> id)
-> execute ();
}
}

$ status = parent :: save ($ form, $ form_state);

switch ($ status) {
case SAVED_NEW:
drupal_set_message ($ this-> t (& # 39; The person "% label" has been added. [
        '%label' => $entity->label(),
      ]));
Pause;
default:
drupal_set_message ($ this-> t (& # 39; The person "% label" has been changed. [
        '%label' => $entity->label(),
      ]));
}
$ form_state-> setRedirect (& # 39; entity.person.canonical & # 39 ;, ['person' => $entity->id()])
}

When I run this, the table "person" in the database is correctly updated but via my Drupal interface, the previous person is still considered to have 'iscontact'. = 1.
This is correct only after clearing the cache memory …
What am I doing wrong?