```
io.realm:realm-gradle-plugin:2.0.0'
Android Studio 2.2.2

```

I am trying to delete objects from the realm database. The items seems to get deleted. But when I close the app and load items from the database the deleted ones still seem to have a reference to them. This is my code below for deleting.

If the delete onSuccess is called I send back the item to be removed from the recyclerview's adapter. Is this the correct way to do this?

```
 @Override
    public void deletePerson(final Person person, final DeleteListener deleteListener) {
        mRealm.executeTransactionAsync(new Realm.Transaction() {
            @Override
            public void execute(Realm realm) {
                RealmResults<Person> results = realm.where(Person.class).equalTo("mId", person.getId()).findAll();
                results.deleteAllFromRealm();
            }
        }, new Realm.Transaction.OnSuccess() {
            @Override
            public void onSuccess() {
                /* send the person object back to be removed from the recyclerview after success*/
                deleteListener.onDeleteSuccess(person);
            }
        }, new Realm.Transaction.OnError() {
            @Override
            public void onError(Throwable error) {
                deleteListener.onDeleteFailure(error.getMessage());
            }

    });
}

```

And when I load the persons the ones that are deleted seem to have a reference in realm and doesn't seem to be completely removed.

```
@Override
    public void loadPersons(final LoadPersonListener loadPersonListener) {
        if(mRealm.isClosed()) {
            mRealm = Realm.getDefaultInstance();
        }

        RealmResults<Person> personsList = mRealm.where(Person.class).findAll();
        if(personsList.size() > 0) {
            loadPersonListener.onLoadPersonSuccess(personsList);
        }
        else {
            loadPersonListener.onLoadPersonFailure("No items in the database");
        }
    }

```