Re: using callbacks with connect_cached

Vincent Veyron <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
Le jeudi 22 août 2013 à 00:08 +0200, David E. Wheeler a écrit :

> Try the connected callback, instead:
> 
>   http://justatheory.com/computers/databases/postgresql/execute-on-select.html
> 


Hi David,

I did study your fine article for my research, thank you for that :-)

But you must have overlooked the part of my post where I write that the
connected callback creates a new handle for each query in the database;
no caching happens as one can see with CackedKids after a few queries

Apache is configured with MaxClients=1, so that only one process is
active.

There should be only two cached handles (one with
private_preferred_datestyle ='iso', one 'SQL, dmy') :


          'cachedkids' => '$VAR1 = {
          \'dbname=aspro!www-data!!AutoCommit='1',Callbacks='HASH(0x7f919fb1c480)',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',Callbacks='HASH(0x7f919faf2c78)',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',Callbacks='HASH(0x7f919fad0768)',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',Callbacks='HASH(0x7f919fb0dd68)',PrintError='1',RaiseError='1',Username='www-data',dbi_connect_method='connect_cached',pg_bool_tf='t',private_preferred_datestyle='SQL, dmy'\' => bless( {}, \'DBI::db\' ),
          \'dbname=aspro!www-data!!AutoCommit='1',Callbacks='HASH(0x7f919fb0d000)',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',Callbacks='HASH(0x7f919fb2c9f0)',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',Callbacks='HASH(0x7f919fa76b88)',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',Callbacks='HASH(0x7f919fab1d00)',PrintError='1',RaiseError='1',Username='www-data',dbi_connect_method='connect_cached',pg_bool_tf='t',private_preferred_datestyle='SQL, dmy'\' => bless( {}, \'DBI::db\' )
        };

-- 
Salutations, Vincent Veyron 
http://marica.fr/ 
Gestion des contrats, des contentieux juridiques et des sinistres
d'assurance
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.