From: Ilya M. <il...@ma...> - 2002-05-30 06:12:30
|
>>>>> On Wed, 29 May 2002 22:55:06 -0700, "Jonathan Swartz" <sw...@po...> said: JS> I'm not sure why do you need to $dbh->disconnect after the request JS> is over, though - that seems like a performance hit. Why not JS> declare $dbh in <%once>, and connect only if it is undefined? I would not recommend init $dbh in <%once>. If your web site is not high traffic than database connection can easily timeout, say, during night hours. It is better to use Apache::DBI and call connect/disconnect on each request. Apache::DBI will take care about caching connection and checking if it still valid. Moreover as I understand if you init database connection in <%once> and precompile components during Apache startup than single database connection get shared among Apache childs. But since single database connection cannot be used by several processes at same time than it just doesn't work. -- Ilya Martynov (http://martynov.org/) |