Le samedi 24 août 2013 à 21:01 +0200, David E. Wheeler a écrit :
> On Aug 24, 2013, at 1:32 AM, Vincent Veyron <vv.li...@wanadoo.fr> wrote:
> 
> >> Pretty sure the connected callback will work, too.
> > 
> > It certainly does, I've checked, but this callback would add a query to
> > each connection. 
> 
> Is that not what you want?

Hi David,

Not quite : I thought connected_cache.new would enable me to set the
correct datestyle once for a cached connection, and then be cached with
it, but we've seen that won't work.

Using the connected callback would do a 'set datestyle to xyz' for each
connection, even if cached. I realize it's no big deal (.5ms on my lowly
Atom processor), but every little bit helps, as I'm sure you know. 

So I now set the datestyle when the user logs in (hence once, with
$dbh->do('SET datestyle TO xyz'), and the database handle is cached and
reused as is.

-- 
Salutations, Vincent Veyron 
http://marica.fr/ 
Gestion des contrats, des contentieux juridiques et des sinistres
d'assurance

Reply via email to