[Catalyst] Apache <-> DB-Problem

Jules Bean jules at jellybean.co.uk
Sun Nov 6 13:05:29 CET 2005


Florian Rossol wrote:
> Apache is generating '200' request all the time.
>
>   
Good.

> I'm pretty sure that this has something to do with the
> apache-childs. Is there any chance to find out, which child answered a
> request. If this is possible I can associate the served version of the
> page to a single child.
>   

You can log $$, I guess. Each child should have a separate pid unless 
your apache is using lightweight threads on some OS which supports that 
notion (I'm hazy on apache setup, sorry).

Anyhow I doubt you'll learn the cause of the bug that way. I'm quite 
sure you're right that this is the cause of the inconsistency between 
subsequent requests. However the cause of the *bug* is possibly that you 
are directly or indirectly reusing perl variables instead of refetching 
from the DB. It could be directly in your code, or indirectly through 
Class::DBI. (You are presumably aware that mod_perl is a persistent perl 
environment and that therefore variables persist between requests, 
within each process). You should examine how you fetch data and make 
sure the database is being hit every time. (Well, it almost certainly is 
not, unless you are using full ACID and you are never committing, so you 
are maintaining separate state on each DB connection). You may find DBI 
Trace instructive (man DBI), or you may alternately turn on query 
logging at the DB end.

Jules




More information about the Catalyst mailing list