users@glassfish.java.net

Re: reset entity cache but...

From: <glassfish_at_javadesktop.org>
Date: Thu, 13 Mar 2008 01:20:45 PST

I solve the problem by using a utilSessionBean with the follow method.

 public void refreshCache(String entityName)
    {
        Query query = em.createQuery("select object(o) from "+entityName+" as o");
        query.setHint("toplink.refresh", "true");
        List list = query.getResultList();
        list.clear(); list = null;
    }

So, I call it thru a servlet when I need to refresh the cache.
[Message sent by forum member 'peppeme' (peppeme)]

http://forums.java.net/jive/thread.jspa?messageID=263752