Re: [CDBI] Missing TEMP data

[prev] [thread] [next] [Date index for 2006/01/13]

From: William Ross
Subject: Re: [CDBI] Missing TEMP data
Date: 15:23 on 13 Jan 2006
On 13 Jan 2006, at 15:02, Bill Moseley wrote:

> This is too weird.  I don't even know where to start on this one.
> Three hours of sleep doesn't help, either.  Often posting is the only
> way to see that I'm doing something really, eh,  dumb.  So....
>
>
> I have a query that returns a list of "instructors" and a count() of
> the number of classes they are teaching.  The count() is in a TEMP
> column.  I'm using seq_sql for the query:
>
>     package Person;
>
>     __PACKAGE__->columns( TEMP => 'class_count' );
>     __PACKAGE__->set_sql('count_classes', <<'' );
>         SELECT      me.id, me.first_name, me.last_name,  COUNT 
> (class.id) AS class_count
>         FROM        %s
>         WHERE       %s
>         GROUP BY    me.id, me.first_name, me.last_name
>         %s
>
> In Catalyst every once in a while a few of the rows display the  
> instructor's name,
> but *blank* for the count -- not zero, but blank (or maybe NULL).
> It's just an empty <td> in the html.
>
> If I wrap my call to search() in DBI->trace() (which causes Cat to
> restart) and reload in the browser the counts show up.  Then if I go
> back and remove the trace the and reload, the counts still show.
> Great.  Just great.  Can't figure out how to make it happen.

The key fact here is probably that restarting the application  
corrects the behaviour, which suggests that some of your objects are  
probably already in memory, and having come from a normal retrieval  
method they don't have the temp column. If you're not using any other  
caching, see if disabling the live object index corrects the problem.  
if so, you need to look for scoping problems or perhaps just change  
the way your objects are constructed after the set_sql call so that  
it doesn't go through _init().

?

will

(posting far too much today because real work v dull :)


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

[CDBI] Missing TEMP data
Bill Moseley 15:02 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
William Ross 15:23 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
Perrin Harkins 15:36 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
Bill Moseley 16:40 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
Perrin Harkins 17:01 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
Bill Moseley 17:27 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
Perrin Harkins 18:31 on 13 Jan 2006

Re: [CDBI] Missing TEMP data
Bill Moseley 19:05 on 13 Jan 2006

Generated at 09:31 on 23 Jan 2006 by mariachi v0.52