users@glassfish.java.net

Re: Clear toplink cache from command line

From: Loren Cole <loren.cole_at_gmail.com>
Date: Fri, 9 Jul 2010 14:35:08 -0500

So I built a tiny app to test and em.clear() doesn't clear the session
cache. The documentation says it detaches all attached entities, so I
think you could say it's clearing the persistence context, not the
session cache.

I'm actually really stumped on this one, surely Glassfish isn't built
with a level 2 cache that you can only expire by restarting the
server...

-
Loren

On Wed, Jun 30, 2010 at 2:29 PM, Dominik Dorn <dominik.dorn_at_gmail.com> wrote:
> hmm... shouldn't a basic
>
> em.flush(); / em.clear();
>
> clear the cache?
> then you would simply have to create a page/bean that calls that
> method on an entitymanager .
> if that works, doing that through a mbean should work as well.
>
>
>
> On Wed, Jun 30, 2010 at 9:16 PM,  <glassfish_at_javadesktop.org> wrote:
>> We've got a read mostly application whose database gets updated via an external script once every few weeks or so, but toplink's cache is enabled so none of those updates are visible to the application.  Restarting the server clears the cache, but it's down right tacky to be doing that all the time, does anyone know of another asadmin command I can run which will clear the cache?
>>
>> Failing that, any advise on developing an mbean to do it?
>>
>> Thanks,
>> Loren
>> [Message sent by forum member 'loren_']
>>
>> http://forums.java.net/jive/thread.jspa?messageID=476445
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
>
>
> --
> Dominik Dorn
> http://dominikdorn.com
> http://twitter.com/domdorn
>
> Tausche Deine Lernunterlagen auf http://www.studyguru.eu !
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>