It depends on which cache is being requested to be cleared...

The EntityManager / Persistence Context can be cleared via the em.clear()
invocation.  This is also known as a Level 1 cache.

If you are asking about the Level 2 cache, then as Rick pointed out, it
depends on whether you are using pre-JPA 2.0 level code.  Prior to JPA 2.0,
there was no defined mechanism for working with a L2 cache.  Thus, OpenJPA
1.x provided their own API for performing this function.

Kevin

On Thu, Sep 23, 2010 at 7:54 PM, C N Davies <[email protected]> wrote:

> Em.clear();  seems to do the job for me.
>
> chris
>
>
>
> -----Original Message-----
> From: nasseria1 [mailto:[email protected]]
> Sent: Friday, 24 September 2010 7:32 AM
> To: [email protected]
> Subject: How to reset OpenJPA cache
>
>
> Hi all,
> After reading OpenJPA, I could not find a clear way to clear OpenJPA cache.
> Is there any API that developers call it to reset entity cache?
>
> Thanks for the attention,
> Nasser Fard
> --
> View this message in context:
>
> http://openjpa.208410.n2.nabble.com/How-to-reset-OpenJPA-cache-tp5564799p556
> 4799.html<http://openjpa.208410.n2.nabble.com/How-to-reset-OpenJPA-cache-tp5564799p556%0A4799.html>
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>

Reply via email to