cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Herrmann <frank.herrm...@modernizingmedicine.com>
Subject Re: Object Cache and Child Objects - Cayenne 3.1
Date Thu, 19 May 2016 12:55:53 GMT
Thanks for the quick response. :)

On Thu, May 19, 2016 at 6:19 AM, Andrus Adamchik <andrus@objectstyle.org>
wrote:

> Just committed a fix to 3.1 and 4.0 branches:
> https://issues.apache.org/jira/browse/CAY-2084
>
>
> > On May 18, 2016, at 5:27 PM, Frank Herrmann <
> frank.herrmann@modernizingmedicine.com> wrote:
> >
> > Thanks.
> >
> > On Wed, May 18, 2016 at 10:25 AM, Andrus Adamchik <
> andrus@objectstyle.org>
> > wrote:
> >
> >> In 4.0 we are using SelectById query that hits query cache, which I am
> >> pretty sure is free of this issue.
> >>
> >> Will need to investigate ObjectIdQuery behavior.
> >>
> >> Andrus
> >>
> >>> On May 18, 2016, at 5:22 PM, Frank Herrmann <
> >> frank.herrmann@modernizingmedicine.com> wrote:
> >>>
> >>> Hi Andrus,
> >>>
> >>> Yes, superclass/subclass. We are using Cayenne.objectForQuery(...);
> >>>
> >>> Specifically,
> >>>
> >>> Cayenne.*objectForQuery*(dataContext, *new* ObjectIdQuery(oid, *false*,
> >>> ObjectIdQuery.*CACHE*));
> >>>
> >>> On Wed, May 18, 2016 at 10:11 AM, Andrus Adamchik <
> >> andrus@objectstyle.org>
> >>> wrote:
> >>>
> >>>>> I have a question and an observation. While reading some of the
> Cayenne
> >>>>> code, we've noticed reference to a snapshot cache. Is this the object
> >>>>> cache, or something different?
> >>>>
> >>>> Correct. This is shared object cache.
> >>>>
> >>>>> The issue we are seeing has to do with cayenne objects that are
> >>>>> parents/children of other cayenne objects. For instance, we have
a
> User
> >>>>> object, we also have Staff and Patient objects that are children
of
> the
> >>>>> User object.
> >>>>
> >>>> By parent/child you mean superclass/subclass?
> >>>>
> >>>>>
> >>>>> What we have seen is that if a developer does a query for a User
> object
> >>>> by
> >>>>> id, the object is retrieved. Cayenne sees that this object is a
Staff
> >>>>> object and then stores it in the object cache as a Staff object.
The
> >> next
> >>>>> time the user goes to retrieve the User object (by the same id),
> >> Cayenne
> >>>>> does another call to the database, because it cannot find the User
> >> object
> >>>>> in the cache (because it stored it as a Staff object).
> >>>>
> >>>> Could be a bug. Which API are you using? Cayenne.objectForPK(..) ?
> >>>>
> >>>> Andrus
> >>>>
> >>>>
> >>>>
> >>>>> On May 18, 2016, at 4:31 PM, Frank Herrmann <
> >>>> frank.herrmann@modernizingmedicine.com> wrote:
> >>>>>
> >>>>> Hello all,
> >>>>>
> >>>>> I have a question and an observation. While reading some of the
> Cayenne
> >>>>> code, we've noticed reference to a snapshot cache. Is this the object
> >>>>> cache, or something different?
> >>>>>
> >>>>> The issue we are seeing has to do with cayenne objects that are
> >>>>> parents/children of other cayenne objects. For instance, we have
a
> User
> >>>>> object, we also have Staff and Patient objects that are children
of
> the
> >>>>> User object.
> >>>>>
> >>>>> What we have seen is that if a developer does a query for a User
> object
> >>>> by
> >>>>> id, the object is retrieved. Cayenne sees that this object is a
Staff
> >>>>> object and then stores it in the object cache as a Staff object.
The
> >> next
> >>>>> time the user goes to retrieve the User object (by the same id),
> >> Cayenne
> >>>>> does another call to the database, because it cannot find the User
> >> object
> >>>>> in the cache (because it stored it as a Staff object).
> >>>>>
> >>>>> Thanks again for the help.
> >>>>>
> >>>>> -Frank
> >>>>>
> >>>>> --
> >>>>> FRANK HERRMANN
> >>>>> SOFTWARE ENGINEER
> >>>>>
> >>>>> T: 561-880-2998 x1563
> >>>>>
> >>>>> E: frank.herrmann@modmed.com
> >>>>>
> >>>>>
> >>>>>
> >>>>> [image: [ Modernizing Medicine ]] <http://www.modmed.com/>
> >>>>> [image: [ Facebook ]] <http://www.facebook.com/modernizingmedicine>
> >>>> [image:
> >>>>> [ LinkedIn ]] <http://www.linkedin.com/company/modernizing-medicine/
> >
> >>>> [image:
> >>>>> [ YouTube ]] <http://www.youtube.com/user/modernizingmedicine>
> >> [image: [
> >>>>> Twitter ]] <https://twitter.com/modmed_EMA> [image: [ Blog
]]
> >>>>> <http://www.modmed.com/BlogBeyondEMR> [image: [ Instagram
]]
> >>>>> <http://instagram.com/modernizing_medicine>
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> FRANK HERRMANN
> >>> SOFTWARE ENGINEER
> >>>
> >>> T: 561-880-2998 x1563
> >>>
> >>> E: frank.herrmann@modmed.com
> >>>
> >>>
> >>>
> >>> [image: [ Modernizing Medicine ]] <http://www.modmed.com/>
> >>> [image: [ Facebook ]] <http://www.facebook.com/modernizingmedicine>
> >> [image:
> >>> [ LinkedIn ]] <http://www.linkedin.com/company/modernizing-medicine/>
> >> [image:
> >>> [ YouTube ]] <http://www.youtube.com/user/modernizingmedicine>
> [image: [
> >>> Twitter ]] <https://twitter.com/modmed_EMA> [image: [ Blog ]]
> >>> <http://www.modmed.com/BlogBeyondEMR> [image: [ Instagram ]]
> >>> <http://instagram.com/modernizing_medicine>
> >>
> >>
> >
> >
> > --
> > FRANK HERRMANN
> > SOFTWARE ENGINEER
> >
> > T: 561-880-2998 x1563
> >
> > E: frank.herrmann@modmed.com
> >
> >
> >
> > [image: [ Modernizing Medicine ]] <http://www.modmed.com/>
> > [image: [ Facebook ]] <http://www.facebook.com/modernizingmedicine>
> [image:
> > [ LinkedIn ]] <http://www.linkedin.com/company/modernizing-medicine/>
> [image:
> > [ YouTube ]] <http://www.youtube.com/user/modernizingmedicine> [image: [
> > Twitter ]] <https://twitter.com/modmed_EMA> [image: [ Blog ]]
> > <http://www.modmed.com/BlogBeyondEMR> [image: [ Instagram ]]
> > <http://instagram.com/modernizing_medicine>
>
>


-- 
FRANK HERRMANN
SOFTWARE ENGINEER

T: 561-880-2998 x1563

E: frank.herrmann@modmed.com



[image: [ Modernizing Medicine ]] <http://www.modmed.com/>
[image: [ Facebook ]] <http://www.facebook.com/modernizingmedicine> [image:
[ LinkedIn ]] <http://www.linkedin.com/company/modernizing-medicine/> [image:
[ YouTube ]] <http://www.youtube.com/user/modernizingmedicine> [image: [
Twitter ]] <https://twitter.com/modmed_EMA> [image: [ Blog ]]
<http://www.modmed.com/BlogBeyondEMR> [image: [ Instagram ]]
<http://instagram.com/modernizing_medicine>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message