You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Markus Reich <ma...@markusreich.at> on 2013/05/08 13:37:17 UTC

Disabling caching for relationship queries

Hi,

is there a possibility to disable the default cayenne caching mechanism
used to get relational data?
I already set Shared Cache to false and Number of Objects to 0, but it
still doesn't work :-(

regards
Meex

Re: Disabling caching for relationship queries

Posted by Markus Reich <ma...@markusreich.at>.
thx, now everything is much clearer :-)


2013/5/9 Andrus Adamchik <an...@objectstyle.org>

> In this situation related objects are not fetched by the query (they are
> resolved when you read them via getter of MiiPickingcontainer). So there's
> no any specific caching/refreshing rules involved. Instead related objects
> simply stay around as long as their owning MiiPickingcontainer objects are
> in scope.
>
> To refresh relationships when you execute a query, you need to specify
> prefetching for each relationship you care to refresh:
>
>
> http://cayenne.apache.org/docs/3.1/cayenne-guide/performance-tuning.html#prefetching
>
> Andrus
>
> On May 8, 2013, at 2:48 PM, Markus Reich <ma...@markusreich.at>
> wrote:
>
> > e.g.
> >    SelectQuery query = new SelectQuery(MiiPickingcontainer.class);
> >    query.setQualifier(expression);
> >    query.addOrdering(MiiPickingcontainer.MESSTART_PROPERTY,
> > SortOrder.ASCENDING);
> >
> >    @SuppressWarnings("unchecked")
> >    List<MiiPickingcontainer> containers = ctxt.performQuery(query);
> >    return containers;
> >
> > MiiPickingcontainer has n MiiPickingcontainerPositions and a Position has
> > an 1:1 order
> >
> >
> > 2013/5/8 Andrus Adamchik <an...@objectstyle.org>
> >
> >> Which query are we talking about? Could you provide a code sample
> please.
> >>
> >> Andrus
> >>
> >> On May 8, 2013, at 2:37 PM, Markus Reich <ma...@markusreich.at>
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> is there a possibility to disable the default cayenne caching mechanism
> >>> used to get relational data?
> >>> I already set Shared Cache to false and Number of Objects to 0, but it
> >>> still doesn't work :-(
> >>>
> >>> regards
> >>> Meex
> >>
> >>
> >
> >
> > --
> > *Markus Reich*
> > Moosbach 28/2
> > 6392 St. Jakob i.H.
> > www.markusreich.at / www.meeximum.at
> > markus.reich@markusreich.at
>
>


-- 
*Markus Reich*
Moosbach 28/2
6392 St. Jakob i.H.
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: Disabling caching for relationship queries

Posted by Markus Reich <ma...@markusreich.at>.
thx


2013/5/9 Michael Gentry <mg...@masslight.net>

> You can also use a RelationshipQuery to refresh the objects in a
> relationship:
>
> http://cayenne.apache.org/docs/3.0/relationshipquery.html
>
>
>
> On Thu, May 9, 2013 at 4:34 AM, Andrus Adamchik <andrus@objectstyle.org
> >wrote:
>
> > In this situation related objects are not fetched by the query (they are
> > resolved when you read them via getter of MiiPickingcontainer). So
> there's
> > no any specific caching/refreshing rules involved. Instead related
> objects
> > simply stay around as long as their owning MiiPickingcontainer objects
> are
> > in scope.
> >
> > To refresh relationships when you execute a query, you need to specify
> > prefetching for each relationship you care to refresh:
> >
> >
> >
> http://cayenne.apache.org/docs/3.1/cayenne-guide/performance-tuning.html#prefetching
> >
> > Andrus
> >
> > On May 8, 2013, at 2:48 PM, Markus Reich <ma...@markusreich.at>
> > wrote:
> >
> > > e.g.
> > >    SelectQuery query = new SelectQuery(MiiPickingcontainer.class);
> > >    query.setQualifier(expression);
> > >    query.addOrdering(MiiPickingcontainer.MESSTART_PROPERTY,
> > > SortOrder.ASCENDING);
> > >
> > >    @SuppressWarnings("unchecked")
> > >    List<MiiPickingcontainer> containers = ctxt.performQuery(query);
> > >    return containers;
> > >
> > > MiiPickingcontainer has n MiiPickingcontainerPositions and a Position
> has
> > > an 1:1 order
> > >
> > >
> > > 2013/5/8 Andrus Adamchik <an...@objectstyle.org>
> > >
> > >> Which query are we talking about? Could you provide a code sample
> > please.
> > >>
> > >> Andrus
> > >>
> > >> On May 8, 2013, at 2:37 PM, Markus Reich <markus.reich@markusreich.at
> >
> > >> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> is there a possibility to disable the default cayenne caching
> mechanism
> > >>> used to get relational data?
> > >>> I already set Shared Cache to false and Number of Objects to 0, but
> it
> > >>> still doesn't work :-(
> > >>>
> > >>> regards
> > >>> Meex
> > >>
> > >>
> > >
> > >
> > > --
> > > *Markus Reich*
> > > Moosbach 28/2
> > > 6392 St. Jakob i.H.
> > > www.markusreich.at / www.meeximum.at
> > > markus.reich@markusreich.at
> >
> >
>



-- 
*Markus Reich*
Moosbach 28/2
6392 St. Jakob i.H.
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: Disabling caching for relationship queries

Posted by Michael Gentry <mg...@masslight.net>.
You can also use a RelationshipQuery to refresh the objects in a
relationship:

http://cayenne.apache.org/docs/3.0/relationshipquery.html



On Thu, May 9, 2013 at 4:34 AM, Andrus Adamchik <an...@objectstyle.org>wrote:

> In this situation related objects are not fetched by the query (they are
> resolved when you read them via getter of MiiPickingcontainer). So there's
> no any specific caching/refreshing rules involved. Instead related objects
> simply stay around as long as their owning MiiPickingcontainer objects are
> in scope.
>
> To refresh relationships when you execute a query, you need to specify
> prefetching for each relationship you care to refresh:
>
>
> http://cayenne.apache.org/docs/3.1/cayenne-guide/performance-tuning.html#prefetching
>
> Andrus
>
> On May 8, 2013, at 2:48 PM, Markus Reich <ma...@markusreich.at>
> wrote:
>
> > e.g.
> >    SelectQuery query = new SelectQuery(MiiPickingcontainer.class);
> >    query.setQualifier(expression);
> >    query.addOrdering(MiiPickingcontainer.MESSTART_PROPERTY,
> > SortOrder.ASCENDING);
> >
> >    @SuppressWarnings("unchecked")
> >    List<MiiPickingcontainer> containers = ctxt.performQuery(query);
> >    return containers;
> >
> > MiiPickingcontainer has n MiiPickingcontainerPositions and a Position has
> > an 1:1 order
> >
> >
> > 2013/5/8 Andrus Adamchik <an...@objectstyle.org>
> >
> >> Which query are we talking about? Could you provide a code sample
> please.
> >>
> >> Andrus
> >>
> >> On May 8, 2013, at 2:37 PM, Markus Reich <ma...@markusreich.at>
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> is there a possibility to disable the default cayenne caching mechanism
> >>> used to get relational data?
> >>> I already set Shared Cache to false and Number of Objects to 0, but it
> >>> still doesn't work :-(
> >>>
> >>> regards
> >>> Meex
> >>
> >>
> >
> >
> > --
> > *Markus Reich*
> > Moosbach 28/2
> > 6392 St. Jakob i.H.
> > www.markusreich.at / www.meeximum.at
> > markus.reich@markusreich.at
>
>

Re: Disabling caching for relationship queries

Posted by Andrus Adamchik <an...@objectstyle.org>.
In this situation related objects are not fetched by the query (they are resolved when you read them via getter of MiiPickingcontainer). So there's no any specific caching/refreshing rules involved. Instead related objects simply stay around as long as their owning MiiPickingcontainer objects are in scope. 

To refresh relationships when you execute a query, you need to specify prefetching for each relationship you care to refresh:

http://cayenne.apache.org/docs/3.1/cayenne-guide/performance-tuning.html#prefetching

Andrus

On May 8, 2013, at 2:48 PM, Markus Reich <ma...@markusreich.at> wrote:

> e.g.
>    SelectQuery query = new SelectQuery(MiiPickingcontainer.class);
>    query.setQualifier(expression);
>    query.addOrdering(MiiPickingcontainer.MESSTART_PROPERTY,
> SortOrder.ASCENDING);
> 
>    @SuppressWarnings("unchecked")
>    List<MiiPickingcontainer> containers = ctxt.performQuery(query);
>    return containers;
> 
> MiiPickingcontainer has n MiiPickingcontainerPositions and a Position has
> an 1:1 order
> 
> 
> 2013/5/8 Andrus Adamchik <an...@objectstyle.org>
> 
>> Which query are we talking about? Could you provide a code sample please.
>> 
>> Andrus
>> 
>> On May 8, 2013, at 2:37 PM, Markus Reich <ma...@markusreich.at>
>> wrote:
>> 
>>> Hi,
>>> 
>>> is there a possibility to disable the default cayenne caching mechanism
>>> used to get relational data?
>>> I already set Shared Cache to false and Number of Objects to 0, but it
>>> still doesn't work :-(
>>> 
>>> regards
>>> Meex
>> 
>> 
> 
> 
> -- 
> *Markus Reich*
> Moosbach 28/2
> 6392 St. Jakob i.H.
> www.markusreich.at / www.meeximum.at
> markus.reich@markusreich.at


Re: Disabling caching for relationship queries

Posted by Markus Reich <ma...@markusreich.at>.
e.g.
    SelectQuery query = new SelectQuery(MiiPickingcontainer.class);
    query.setQualifier(expression);
    query.addOrdering(MiiPickingcontainer.MESSTART_PROPERTY,
SortOrder.ASCENDING);

    @SuppressWarnings("unchecked")
    List<MiiPickingcontainer> containers = ctxt.performQuery(query);
    return containers;

MiiPickingcontainer has n MiiPickingcontainerPositions and a Position has
an 1:1 order


2013/5/8 Andrus Adamchik <an...@objectstyle.org>

> Which query are we talking about? Could you provide a code sample please.
>
> Andrus
>
> On May 8, 2013, at 2:37 PM, Markus Reich <ma...@markusreich.at>
> wrote:
>
> > Hi,
> >
> > is there a possibility to disable the default cayenne caching mechanism
> > used to get relational data?
> > I already set Shared Cache to false and Number of Objects to 0, but it
> > still doesn't work :-(
> >
> > regards
> > Meex
>
>


-- 
*Markus Reich*
Moosbach 28/2
6392 St. Jakob i.H.
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: Disabling caching for relationship queries

Posted by Andrus Adamchik <an...@objectstyle.org>.
Which query are we talking about? Could you provide a code sample please.

Andrus

On May 8, 2013, at 2:37 PM, Markus Reich <ma...@markusreich.at> wrote:

> Hi,
> 
> is there a possibility to disable the default cayenne caching mechanism
> used to get relational data?
> I already set Shared Cache to false and Number of Objects to 0, but it
> still doesn't work :-(
> 
> regards
> Meex