On 6/27/11 11:44 AM, "McCarrell, Jeff" <jmcca...@akamai.com> wrote:
>While this may not be the last word on this subject of DBIx::Class Db conn >caching, >a cursory glance at the documentation shows: >(http://search.cpan.org/~frew/DBIx-Class-0.08192/lib/DBIx/Class/Manual/Int >r >o.pod#Connecting) > > Note that DBIx::Class::Schema does not cache connections for > you. If you use multiple connections, you need to do this > manually. Poking a little bit further, (http://search.cpan.org/~frew/DBIx-Class-0.08192/lib/DBIx/Class/Storage/DBI .pm#connect_info) it looks like DBIx::Class caches statement handles via DBI (see disable_sth_caching which explicitly disables this caching) and that the design is oriented toward re-connecting to the DB transparently, as long as AutoCommit is turned on; which Apache::DBI also does. I believe that DBIx::Class is not as well suited for interleaving different SQL statements on the same connection as Apache::DBI because of its deeper assumptions about error handling and the state it assumes across SQL statements. So it appears that DBIx::Class does do its own connection handling, but aimed at a different design center than Apache::DBI. HTH, -- jeff