EclipseLink 2.3: Clear cache through application [message #1387727] |
Wed, 25 June 2014 13:58 |
Subhadip Chatterjee Messages: 12 Registered: December 2013 |
Junior Member |
|
|
Hello,
In my application, there is facility to clear EclipseLink session cache, by calling the API.
The UI shows Descriptor names in a multi-select box and upon selection user can click to clear the cache.
The code that is written, to clear class-specific cache, is:
session.getIdentityMapAccessor().initializeIdentityMap(Class.forName(cacheClassName));
The code that is written, to clear complete cache, is:
session.getIdentityMapAccessor().initializeAllIdentityMaps();
Now the application is single-tier deployment i.e. complete web+business+persistence code in one EAR package.
With the above setup, still I am not seeing any change in cache.
I confirmed this by changing few attributes of the cached record, directly in database and then from the Web-page cleared the cache of the object. But the records are still remaining as old data.
Any clue?
|
|
|
|
|
|
Re: EclipseLink 2.3: Clear cache through application [message #1388162 is a reply to message #1387778] |
Thu, 26 June 2014 04:21 |
Subhadip Chatterjee Messages: 12 Registered: December 2013 |
Junior Member |
|
|
Hi Chris,
Thanks for the hint. There's no UoW lying for an extended period, as the code shows [the application is in non-JPA style, so EntityManager is not configured]. I have now switched to invalidateAll() and invalidateClass(clazz, boolean) invocations, after seeing your post.
One more thing to ask.
Should I call validateCache() post any CRUD operations? If not, when is this method best used? Is it going to slow down the performance?
[Updated on: Thu, 26 June 2014 04:22] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03658 seconds