persistence@glassfish.java.net

RE: Clear All

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Mon, 28 Jan 2008 16:02:39 -0500

Hello Adam,
 What you are looking for is :
    ((oracle.toplink.essentials.ejb.cmp3.EntityManager)em).getServerSession().getIdentityMapAccessor().invalidateAll();
 Invalidating the entire cache should be avoided within an application why are you invalidating the entire cache? There may be a more efficient practice.
--Gordon


-----Original Message-----
From: Adam Bien [mailto:abien_at_adam-bien.com]
Sent: Monday, January 28, 2008 11:20 AM
To: persistence_at_glassfish.dev.java.net
Subject: Clear All


Hello,

is it possible to clear all entities in the TopLink Caches? The method
EntityManager::clear() expects an Entity as an argument - so you have to
hold all attached entities which have to have cleared (which is hard in
the practice).

I know this functionality is proprieatary and not a part of the JPA
standard. Is there a way in TopLink Essentials to clear all entities in
the second level cache?

thank you in advance,

regards,

adam