I'm using the newest version of realm, and have this inconsistency problem:
this line of code :
realm.where(Realm_Building.class).findAll()
return either a list of 166 elements or zero elements. I have a few tens of api requests using this code one after another without changing anything in the database.
what might be causing this?
EDIT:
this is the entire function:
public Building getBuilding(String buildingInternalId) {
Building building = null;
Realm realm = Realm.getInstance(realmConfig_data);
Realm_Building realm_building =
realm.where(Realm_Building.class).equalTo("internalId",
buildingInternalId).findFirst();
if (realm_building != null){
building = new Building(realm_building);
building.setMachines(getMachines(building.getInternalId()));
}
return building;
}
this line - realm.where(Realm_Building.class).findAll() is in the watch. I get a list and check the size of it.