I suggest this be included in the current release once
people are able
to test it out thoroughly - basically, it forces caching of
the DBI
connections by Apache Process ID, so that each process gets
it's own DBI
connection - prevents problems when forking(), etc... Might
even improve
performance if the DBI caching algorithm blocks until a
cached
connection that is in use by one process is released before
returning a
handle to it... not sure if that's the case.
I can't imagine how this patch would break anything - the
only side
effect is that more connections are established to the
database
initially - one per Apache child process when Apache starts
- but since
each request is handled in a round-robin fashion by Apache's
child
processes, and new processes are not typically started
unless deemed
necessary, it's really only a handful of increased
connections... it's
probably a good thing to have a few more connections sitting
around for
handling Bric requests.
Index: Bric/Util/DBI.pm
============================================================
=======
--- Bric/Util/DBI.pm (revision 187)
+++ Bric/Util/DBI.pm (working copy)
 -1745,6
+1745,7 
sub _connect {
my $dbh = eval {
+ $ATTR-> = $$;
my $d = DBI->connect_cached(join(':', 'DBI',
DBD_TYPE,
DSN_STRING),
CONNECT_USER,
CONNECT_PASS, $ATTR);
# Make sure we're consistent about what we think
the
transaction
------------------------------------------------------------
------------
-----------
Dave Beaudet
d-beaudet nga.gov
(202) 312-2755
------------------------------------------------------------
------------
-----------
"Computers are useless. They can only give you
answers."
- Pablo Picasso
|