Re: Documentation blues

[prev] [thread] [next] [Date index for 2005/06/21]

From: Cees Hek
Subject: Re: Documentation blues
Date: 17:01 on 21 Jun 2005
On 6/21/05, Jacinta Richardson <jarich@xxxxxxxxxxxx.xxx.xx> wrote:
> I'm back to not getting numprojects.  If I perform a search which only in=
cludes
> some of the employees before performing this search then I get a mix wher=
e some
> objects have the numprojects and others don't.  This is obviously less th=
an ideal.
>=20
> It's pretty clear that what is happening is that since the objects my sea=
rch is
> turning up already exist in the global cache of objects they're not being
> created and thus aren't gaining this new column value.

What you can do to solve this is create your own numprojects accessor
(ie override the one that CDBI creates for you).  It can look to see
if the value exists in the TEMP column, and if it doesn't, it can
perform a simple database query to populate it.  That way you can
continue to use the cache, at the expense of a couple of extra queries
to the DB when your value is not populated, and from the outside
everything still works as normal.  You can then also make the accessor
read-only, since it doesn't make sense to be able to update this
column since it is virtual.

Cheers,

Cees

Documentation blues
Jacinta Richardson 12:14 on 21 Jun 2005

Re: Documentation blues
Jacinta Richardson 12:37 on 21 Jun 2005

Re: Documentation blues
Perrin Harkins 13:44 on 21 Jun 2005

Re: Documentation blues
Jacinta Richardson 14:29 on 21 Jun 2005

Re: Documentation blues
Perrin Harkins 17:02 on 21 Jun 2005

Re: Documentation blues
Lonely Rolling Star 00:37 on 04 Jul 2005

Re: Documentation blues
Perrin Harkins 02:00 on 05 Jul 2005

Re: Documentation blues
Cees Hek 17:01 on 21 Jun 2005

Re: Documentation blues
Kingsley Kerce 13:06 on 21 Jun 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52