[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: timing queries..
i have seen the 'get' and 'set' methods being called so many times during the
request response loop
that i just hate to stick my DB access code (fetch) in there . Instead I think
its a better idea to put it in
a place like appendToResponse which just gets called once during the loop .
David Scheck wrote:
> you could do it in :
>
> - setChildObject: anObject
> {
> if (childObject == anObject)
> return;
>
> childObject = anOb ject; // don't forget about retains for ObjC (not
> needed in WebScript)
>
> // do the fetch
>
> }
>
> "Schrecengost, James" wrote:
>
> > Okay gang, here's something that has plagued me for a while, and I finally
> > understand what is happening, so I can ask a good question, rather than "It
> > doesn't work - help!".. Here 'tis.
> > I have a child component that gets a single object from a repetition from
> > it's parent.
> > I need to use data from this object to query the DB for what the child is
> > showing.
> > This query needs to run immediately, thus showing the resulting data.
> > Now, when I set up the .wod like this:
> > Child: WOChild {
> > childObject = currentObject;
> > }
> >
> > it doesn't work. Now I figured out why. Because, I put the DB Fetch in
> > either the Constructor, or the awake methods.
> > And, WO, for whatever reason, decides to run those before assigning the
> > childObject (where it gets the info for the query)..
> > Any ideas how to get around this?? Thanks!
> >
> > These opinions are mine, and not necessarily those of my employer.
> >
> > James 'Ghostman' Schrecengost
> > Johns Manville, Electronic Commerce Team
> > schrecen@jm.com
> > 303-978-2677