Le jeudi 22 août 2013 à 18:52 +0200, David E. Wheeler a écrit :
> On Aug 22, 2013, at 8:28 AM, Vincent Veyron <[email protected]> wrote:
> So, do you get a new handle for every query *without* the callback?
>
Caching works as advertised if I take out the callback. Here's how
CachedKids looks after a couple dozen requests :
'cached_kids' => '$VAR1 = {
\'dbname=aspro!www-data!!AutoCommit='1',PrintError='1',RaiseError='1',Username='www-data',dbi_connect_method='connect_cached',pg_bool_tf='t',private_preferred_datestyle='iso'\'
=> bless( {}, \'DBI::db\' ),
\'dbname=aspro!www-data!!AutoCommit='1',PrintError='1',RaiseError='1',Username='www-data',dbi_connect_method='connect_cached',pg_bool_tf='t',private_preferred_datestyle='SQL,
dmy'\' => bless( {}, \'DBI::db\' )
};
Only two handles, as expected.
> Note that DBI will reset all the attributes every time connect_cached is
> called. Maybe you need to delete one or more of the attributes in a
> connect_cached.reused callback?
The problem is that connect_cached.reused never gets triggered (hence
the absence of caching)