When I manually enter an object in MySQL via terminal, Hibernate does not retrieve the list with the updated object, it is always the same as the last query, as if it were taken from a cache.
I tried to do this but it did not work.
public ArrayList<Praga> listarTodasPragas() {
ArrayList<Praga> listaPragas = new ArrayList<>(session.createCriteria(Praga.class).list());
for(Praga p : listaPragas){
session.refresh(p);
}
return listaPragas;
}
Note: The session.close () I close soon after calling another method.