I'm trying to disable EclipseLink 2.4 cache so if the data gets changed in DB by other applications, same data gets refreshed in my application, which is using EclipseLink 2.4, without restarting it. None of these properties seems to 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 option that helped was:
typedQuery.setHint(QueryHints.REFRESH, HintValues.TRUE);
But this is not an option for me, because now that application is written I don't want to search for all queries or em.find()
methods and put this hint in.
EDIT1: Similar problem is described here: http://eclipse.1072660.n5.nabble.com/Notifications-about-external-database-changes-td5389.html
EDIT2: To summarize I would like that all queries and find calls would refresh data taken from database.