I am trying to disable the EclipseLink 2.4 cache, so if the data is changed in the database by other applications, the same data will be updated in my application that uses EclipseLink 2.4 without restarting it. None of these properties work:
<shared-cache-mode>NONE</shared-cache-mode> ... <property name="eclipselink.cache.shared.default" value="false"/> <property name="eclipselink.cache.size.default" value="0"/> <property name="eclipselink.cache.type.default" value="NONE"/> <property name="eclipselink.query-results-cache" value="false"/> <property name="eclipselink.refresh" value="true"/>
The only thing that helped:
typedQuery.setHint(QueryHints.REFRESH, HintValues.TRUE);
But this is not an option for me, because now that this application is written, I do not want to look for all the requests or methods em.find() and insert this hint.
EDIT1: A similar problem is described here: http://eclipse.1072660.n5.nabble.com/Notifications-about-external-database-changes-td5389.html
EDIT2: To summarize, I would like all queries and search calls to update data taken from the database.
source share