2
When I manually insert an object in Mysql via terminal, Hibernate does not recover the list with the updated object, it is always the same as the last query, as if it were taken from some cache.
I tried to do it but it didn’t 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: A Session.close() I close right after calling another method.
welcome to Stackoverflow in English, it would be ideal for you to explain your solution and also format your code, to format the code just give 4 spaces { }.
– João Neto
That’s not quite my problem, and that condition will never be TRUE
– Skywalker
when you load the page in question will be called getListarToday.
– Rocha