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 à 23:32 +0200, David E. Wheeler a écrit :

> What if you change the callback to return a true value?
> 


Do you mean like this (return 1 instead of simply return)? 

    my $dbh = DBI->connect_cached( "DBI:Pg:dbname=aspro", 'www-data',
undef, {
	PrintError =>1,
    	RaiseError => 1,
    	AutoCommit => 1,
    	pg_bool_tf => 't',
	private_preferred_datestyle => $preferred_datestyle,

Callbacks => {
                 "connect_cached.new" => sub {
		     warn "new handle";
		     return 1;
                 },

		 }
				   } ) 	


No change, a new handle is created on every request.



-- 
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.