I use DBVA for Generation of ORM code, which is based on Hibernate, as is known.
Now when I change data in one of my application’s form, I usually perform following steps:
- t = PersistentManager.instance().getSession().beginTransaction();
- save those objects by object.save()
Now when I look at my reloaded form resp. its data, everything looks fine, the changed data is visible. But sometimes (not always) the unchanged, thus stale data is shown, even after the page had shown the correct, new data once. (That is within one JSP-session.)
How can that happen?? After reloading the page a number of times (by pressing CTRL-R in Firefox) the correct data is shown again.
I have disabled browser-cache by putting in my header (on each page, resp. all pages have a common header):
Now my questions are:
- Does this have anything to do with Hibernate/the DBVA generated code at all?
- Is this more likely to be a question of erroneous browser behaviour!?
- Does anyone by chance have any ideas how to improve my situation??
I’m glad I found the hints regarding evict() at all, and the DBVA documentation on the java_orm/flushing_objects page here on the resource section - after searching for a while.
And I was glad that I had seemingly solved my caching problem, but now I see that it hasn’t been solved fully.
Can anyone help?
Regarding browser-caching there are tons of resources on the net, but they are often outdated or misleading, and before I search in that direction I want to make sure that I’m not missing anything else.
Thanks in advance to anyone who can help.