Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Invalidating session cache programmatically?

On Wed, Nov 30, 2011 at 3:32 PM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
1. Take a look at our JpaHelper class.  It provides a number of methods that can unwrap the various JPA constructs.  For the shared cache, you will want to get a hold of the ServerSession.  It has a method called getIdentityMapAccessor() that has cache manipulation API.

2. SessionManager will hold a list of all the top level sessions.  You should be able to call getSessions() on it and then use the same API described above.

OK; thanks.  I've had a look at the MBean source code, and it seems to call through to an IdentityMapAccessor.  Is there a particular reason I shouldn't look this MBean up and invoke its invalidateAllIdentiytMaps() operation?

(For reference: http://www.eclipse.org/eclipselink/api/2.3/org/eclipse/persistence/services/mbean/MBeanRuntimeServicesMBean.html#invalidateAllIdentityMaps%28%29)

This would allow me to avoid mentioning EclipseLink classes or using stupid reflection tricks and would be consuming what looks to me like a public API.  I'm happy to be redirected here, though.

Best,
Laird

--
http://about.me/lairdnelson


Back to the top