[CDBI] Modperl setup

Kate Yoak kate at longmedia.com
Tue Dec 6 21:41:26 GMT 2005


Damn - I hate it when you are right.  Unfortunately, my best guess for where
the extra references live is a child_of relationship I wrote.  I don't use
global variables (mama taught me better than that) - but I am also not doing
anything by way of cleanup with child_of.  It's like has_a, only uses a
separate field name.  So, $student->parent retrieves a Parent while
$student->parent_id doesn't.  I love the relationship despite a long
discussion on here points out that it probably doesn't add very much except
stylistically.  But I just can't live with the idea of $child->parent_id
returning anything other than an id.  :-)  Anyway, at some point I'll try to
figure out where the culprit is.  The cleanup handler works well for now -
so this is the ever-so-ellusive version 1.1 task.  :-)

BTW, I lied about the cleanup handler syntax.  It is of course
PerlCleanupHandler Foo::Cleanup

Foo::Cleanup::handler is then called and it calls
clear_object_index().

:-)
> -----Original Message-----
> From: Ask Bjorn Hansen [mailto:ask at develooper.com]
> Sent: Monday, December 05, 2005 8:07 PM
> To: Kate Yoak
> Cc: Classdbi at Lists. Digitalcraftsmen. Net
> Subject: Re: [CDBI] Modperl setup
>
>
>
> On Dec 5, 2005, at 7:25 PM, Kate Yoak wrote:
>
> > I am experiencing the problem which seems to be related to value
> > caching.
> > $foo->value, when changed, appears to go back to original on some page
> > loads, obtaining the new value on others.  I can verify that the
> > value in
> > the database is new.  If I restart apache, the new value is obtained.
> [...]
> > PerlCleanupHandler Class::DBI::clear_object_index appears to
> > resolve the
> > problem completely.
>
> You most likely have an accidental closure or in some other way you
> are holding a reference to the data somewhere.   If the reference
> count never goes to 0 it doesn't go out of the object cache
> automatically.
>
> http://wiki.class-dbi.com/wiki/Common_problems - search for "After
> updating a record, the changes do not appear".
>
> :-)
>
>   - ask
>
> --
> http://askask.com/  - http://develooper.com/
>
>





More information about the ClassDBI mailing list