Im editing a value of a list from a list view page and meeting an issue that I can not refresh database immediately after calling getEntityManager().merge(). So, I have to refresh one more time so that the system returns accurate data result that I've edited even called getEntityManager().refresh() but still no effect.
getEntityManager().merge(transactions);
getEntityManager().flush();
getEntityManager().refresh(transactions);
I've researched so many posts of this problem before posting this and it took me plenty of time. Sorry for either my bad English or bad coding. I'm a newbie. Thanks alot !
I found my solution already..This's a little related to Jboss Seam framework i'm using
To display list page view, i used getEntityManage() of EntityQuery of Seam.
Meanwhile in Editing it, i was using getEntityManage() of EntityHome.
This leads to refresh() or clear() in EntityHome have no effect anyway and still stored cache until i reloaded the page.
I should have cleared cache in getEntityManage of EntityQuery rather than clearing the one of EntityHome by recalling the list searching query or simply calling getEntityManage.clear() in EntityQuery
Hope this 's useful ! thanks