i'm having troubles with geting my tables to synchronize with a database. The main table in my application represents a mysql database view of two tables joined, and its bound to a result list of a JPA query over that view's entity class. The problem is, when i update some data in my database table, and then repeat calling of myQuery.getResultList, the list of results returned is the same as the one returned before updating that table. So i guess the problem is that the SELECT statement inside my SQL view isn't getting executed every time i query the JPA entity.
here's an example of the code
enManager.getTransaction().begin();
Myentity s = enManager.find(Myentity.class, selected.getMsId());
s.setKom(k);
enManager.getTransaction().commit();
resultList.clear();
resultList.addAll(myQuery.getResultList());
and the resultList stays the same as the one before performing an update. Is there a workaround, or should I start my application from scratch?