Re: Cached Queries Problem
[prev]
[thread]
[next]
[Date index for 2005/04/28]
On Apr 28, 2005, at 9:30 AM, Perrin Harkins wrote:
> David Christensen said:
>>> Have you determined where the name dbdpg_13 comes from? That might
>>> be
>>> a clue.
>>
>> I believe it would be the 13th query that DBD::Pg has cached thus far.
>
> What I'm suggesting is that the code which generates that name may be
> where the caching problem is, so finding it would be useful.
I don't know. My gut right now is that it's Ima::DBI, or it's
DBD::Pg's implementation of prepare_cached. I believe I've fixed the
problem now in any case.
>> One thing that I am doing is trying to preload my Class::DBI subclass
>> in apache (just via a use statement). I'm using one of the table-setup
>> utility functions rather than hard-coding the fields in, so that may
>> be
>> the cause of the problem -- we obviously have to query the database
>> before we can pull info out of the system tables.
>
> This should be safe if you are using my mod_perl code from the wiki
> that
> overrides db_Main(). You can check by turning on debugging for
> Apache::DBI. You should see warnings about skipping the cache during
> server startup.
I am using code you provided from the wiki for db_Main. But I
neglected to close the connection after the initial load. So I think
we ended up with a "shared" dbi handle between apache processed.
(Obviously a big no-no). Once I added a
MyClass::DBI->db_Main->disconnect to the end of the startup file, it
seemed to work ok. (In any case, I haven't come across it yet -- I've
done similar actions which have triggered the errors before, so that's
hopeful.)
Thanks all. I'll get back if things are not fixed, but for right now
it's looking good.
David
|
(message missing)
|