[Catalyst] Shared database handles under mod_perl 2.0 / Catalyst
5.33?
Brandon Black
blblack at gmail.com
Thu Nov 10 20:34:06 CET 2005
On 11/10/05, radium <radium at gmail.com> wrote:
> On 11/10/05, Brandon Black <blblack at gmail.com> wrote:
> > handle, which of course causes occasional prepare_cached -related
> > errors as they step all over each other. I'm pretty sure the shared
> >
>
> Are you sure you are reading to the end of your statement handles? If not,
> you may need to fix that or call finish() on them.
>
All of the database model idioms I'm using right now boil down to one of:
my $rowobj = CDBI::ATable->create({ x => y, a => b});
my $rowobj = CDBI::ATable->retrieve('pkvalue');
{
$rowobj->acolumn('newvalue');
$rowobj->update;
$rowobj->dbi_commit;
}
{
$rowobj->delete;
CDBI::ATable->dbi_commit;
}
CDBI::ATable->count_all;
CDBI::ATable->sql_count_xxx->select_val;
(where CDBI::ATable has a set_sql( xxx => 'SELECT COUNT(*) FROM
__TABLE__ WHERE something = somethingelse') )
Unless there's some "unfinished statement handle" type of thing that
could be invoked by those methods, I don't think so (I'm new to
Class::DBI too).
The most compelling evidences that it's a shared database handle
problem I'm facing are:
1) Problem dissappears under the built-in testing server
(scripts/myapp_server.pl)
2) Problem will not occur as long as all my requests land on a single
apache child. If I tie that child up (telnet host 80) and issue
another request, which goes off to the 2nd child in line, the problem
immediately appears.
3) The PostgreSQL database server only shows a single connection from
anybody, even when I have multiple concurrent children up that have
answered database-backed requests (or at least, tried to).
-- Brandon
More information about the Catalyst
mailing list