Re: [PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?
[email protected] (Sara Leavitt)
| Newsgroups | php.db |
|---|---|
| Message-ID | <[email protected]> |
Hi Lester, Our application is not using php transactions (e.g., COMMIT, ROLLBACK etc.), so I think we are safe there. Are you saying that even if both the mysql_pconnect and PDO connection are persistent that they will be completely separate? (Havn't had a chance to test this empirically just yet.) Thanks, Sara Lester Caine wrote: > Sara Leavitt wrote: >> Hi, >> >> We are about to convert all of our queries using mysql_pconnect to >> prepared statements using PDO database connections. It will take some >> time to convert the hundreds of SQL statements so the plan is to do it >> in phases. Is it a bad idea to have both a mysql_pconnect and a PDO >> connection open for the same application? Will this doubling of our >> database connections for every page hit degrade performance? Any tips >> on the best way to transition to PDO/prepared statements with minimal >> disruption? > > One thing to be careful is if you are relying on 'transactions' to > handle anything. Obviously the transaction has to be in the same > connection just to work. Despite what others have said, the PDO > connection will be different to the generic mysql connection as it is > a separate process. Persistent connections will only reuse an already > open connection, you can't connect two processes to the same > connection. You would not know which process was accessing things. > -- Sara Leavitt, UC Berkeley Event Calendar Coordinator Public Affairs, University of California 2200 Bancroft Way Berkeley, CA 94720-4204 Phone: 510 643-6163 http://events.berkeley.edu