You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by thinkpad33 <mk...@gmail.com> on 2010/05/07 19:04:49 UTC

Disabling caching!

I want to disable caching, so that every Select query returns fresh result
from the DB. I don't want to use refresh(). I tried to set the following:



But still did not work.

Any help is appreciated!
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Disabling-caching-tp5020333p5020333.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Disabling caching!

Posted by Michael Dick <mi...@gmail.com>.
What you tried will disable the L2 cache - a cache which is shared by all
EntityManagers which are created by the same EntityManagerFactory. It will
not disable the 'L1' cache - the cache each EntityManager maintains for
itself.

For example :
MyEntity e1 = em.find(MyEntity.class, 1);   // fetched from database
...
e1 = em.find(MyEntity.class, 1);   // fetched from L1 cache.

If you need to update e1 you can use the em.refresh() method, or you can
call em.clear() to clear the l1 cache and re-run your query. Otherwise we
will use the copy from the L1 cache.

Is this the behavior you're seeing?

-mike

On Fri, May 7, 2010 at 12:35 PM, thinkpad33 <mk...@gmail.com> wrote:

>
> I am sorry this is what I tried:
>
> <property name="openjpa.DataCache" value="false"/>
>  <property name="openjpa.QueryCache" value="false"/>
>
>
> On Fri, May 7, 2010 at 1:15 PM, Daryl Stultz [via OpenJPA] <
> ml-node+5020390-262157817-530202@n2.nabble.com<ml...@n2.nabble.com>
> <ml...@n2.nabble.com>
> >
> > wrote:
>
> > On Fri, May 7, 2010 at 1:04 PM, thinkpad33 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5020390&i=0>>
> > wrote:
> >
> > >
> > > I want to disable caching, so that every Select query returns fresh
> > result
> > > from the DB. I don't want to use refresh(). I tried to set the
> following:
> >
> > >
> > >
> > >
> > > But still did not work.
> > >
> > > Is it just me, or is the thing you tried missing? (I thought maybe
> there
> > was a spoiler alert, so tried to highlight the blank space to see if
> there
> > was white text.)
> >
> > --
> > Daryl Stultz
> > _____________________________________
> > 6 Degrees Software and Consulting, Inc.
> > http://www.6degrees.com
> > mailto:[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5020390&i=1>
> >
> >
> > ------------------------------
> >  View message @
> >
> http://openjpa.208410.n2.nabble.com/Disabling-caching-tp5020333p5020390.html
> > To unsubscribe from Disabling caching!, click here< (link removed) >.
> >
> >
> >
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Disabling-caching-tp5020333p5020486.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: Disabling caching!

Posted by thinkpad33 <mk...@gmail.com>.
I am sorry this is what I tried:

<property name="openjpa.DataCache" value="false"/>
 <property name="openjpa.QueryCache" value="false"/>


On Fri, May 7, 2010 at 1:15 PM, Daryl Stultz [via OpenJPA] <
ml-node+5020390-262157817-530202@n2.nabble.com<ml...@n2.nabble.com>
> wrote:

> On Fri, May 7, 2010 at 1:04 PM, thinkpad33 <[hidden email]<http://user/SendEmail.jtp?type=node&node=5020390&i=0>>
> wrote:
>
> >
> > I want to disable caching, so that every Select query returns fresh
> result
> > from the DB. I don't want to use refresh(). I tried to set the following:
>
> >
> >
> >
> > But still did not work.
> >
> > Is it just me, or is the thing you tried missing? (I thought maybe there
> was a spoiler alert, so tried to highlight the blank space to see if there
> was white text.)
>
> --
> Daryl Stultz
> _____________________________________
> 6 Degrees Software and Consulting, Inc.
> http://www.6degrees.com
> mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=5020390&i=1>
>
>
> ------------------------------
>  View message @
> http://openjpa.208410.n2.nabble.com/Disabling-caching-tp5020333p5020390.html
> To unsubscribe from Disabling caching!, click here< (link removed) >.
>
>
>

-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Disabling-caching-tp5020333p5020486.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Disabling caching!

Posted by Daryl Stultz <da...@6degrees.com>.
On Fri, May 7, 2010 at 1:04 PM, thinkpad33 <mk...@gmail.com> wrote:

>
> I want to disable caching, so that every Select query returns fresh result
> from the DB. I don't want to use refresh(). I tried to set the following:
>
>
>
> But still did not work.
>
> Is it just me, or is the thing you tried missing? (I thought maybe there
was a spoiler alert, so tried to highlight the blank space to see if there
was white text.)

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com