This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I have a login page and once the user is logged in i will add the user object in the servlet session.
This user table has one to many relationships with many tables. One of the table is EmploymentDetails.
One user might have more than one entry in employment table.
When the user wants to see the employment details, he will be taken to the employment details page.
So in the controller, i will do the following before taking him to the jsp page.
Part of the code :
usersDAO.attachClean(user); // Here i am attaching the user to the hibernate session.
if i refresh the page again, the query is not fired as the data is fetched from the Hibernate session.
But, some one else has modified the data in between directly in the table.
But these modified data are not reflected in the JSP page as it still fetch values from hibernate session.
How to prevent this?
If i need to add session.refresh(), Will it trigger the query every time when i refresh the page?
If it is so, how to improve the performance as it has to hit the DB every time?
Also, i have an add button in the screen. On clicking this user will be taken to a page wherein he can add the new employment details.
On submitting the page, the user will agin taken back to the Employment details page. But unable to see the newly added records.