I have developed a web app using Spring Roo (Spring MVC 3), JPA 1, Hibernate, JSTL, JQUERY etc..Persistence Contexts are application managed via a JPA Transaction manager. DB used is MSSQL2005. The application is running on JBOSS 5.
Everything works fine. My question is something that has been on my mind, yet i have yet to come across a suitable answer.
Suppose the following:
- I retrieve some row from Table T using entitymanager.find(), and present the data to a page
- I manually change one of the field values in the row (via SQL an gui tool).
- I immediately repeat step (1), and I have the manually updated value available.
Is this correct? My understanding was that values within the persistence context do not get updated unless:
- calling em.refesh()
- object is not available in PERSISTENCE CONTEXT (--> query DB instead)
My experience seems to contradict the link below, which actually makes logical sense to me.
Updated data (in Database) is not visible via JPA/Eclipselink
Many thanks
NaP