You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Mattia Barbon <mattia.barbon@libero.it>" <ma...@libero.it> on 2007/07/04 09:27:22 UTC

Selectively persistent connections

[Sorry if this is a duplicate, but I believe the first message
 did not get through]

  Hi all,
I am working in an Apache2/mod_perl2 environment, with MySQL DBs, and
I have a somewhat special need with respect to persistent connections;
I need some of the database connections to be persistent,
while most should stay not persistent; also, I'd like to have
a hook, to perform some initialization on a freshly open connection.

  After looking at the documentation/code I do not think I can use
Apache::DBI for that (but I'd love to be proven wrong!). Can anybody
point me towards a solution. I can obviously copy and modify
Apache::DBI, but it seems the kind of code that it's easy to get wrong
in very subtle ways, so I'd rather avoid that.

  Any suggestion appreciated.

Thanks!
Mattia

P.S.: I am not sure if this question is best posted on a DBI
mailing list


------------------------------------------------------
Scegli infostrada: ADSL gratis per tutta lÂ’estate e telefoni senza canone Telecom
http://click.libero.it/infostrada


Re: Selectively persistent connections

Posted by Clinton Gormley <cl...@traveljury.com>.
>   After looking at the documentation/code I do not think I can use
> Apache::DBI for that (but I'd love to be proven wrong!). Can anybody
> point me towards a solution. I can obviously copy and modify
> Apache::DBI, but it seems the kind of code that it's easy to get wrong
> in very subtle ways, so I'd rather avoid that.

DBI provides connect() and connect_cached()

That'll probably give you what you need

Clint