Hi,

Саша Стаменковић wrote:
> This error occurs only on one admin page in my project,
> when I try to iterate over rowset, in each iteration 
> change sth in the row and save it (old version)
> or I use quoteInto() with array of ids in update query (new version).

Can you monitor the used mysqld? This should really tell you, when and where 
the connections came from.
At least you should be able to do this, when you run your project in your local 
development system with your own mysqld.


> I would like to hear what do you think about switching adapter
> from MySQLi to PDO and setting 'persistent' => true for db connection
> in my config file? Will that solve the problem?

I don't think that this will solve your problem.

First, when you are using Zend_Db, I would recommend to use one of the native 
DB connectors, because Zend_Db is already your DB abstraction layer so you 
don't need another one. Read <http://blog.ulf-wendel.de/?p=187> for more 
information.

Secondly, you should understand what persistent connections means:
When you establish a persistent connection, you tell your mysqld "Do not 
*really* close the connection, if I (the client) close it". So when your script 
comes back and tries to establish a new connection, the mysqld will search in 
the connection pool if there is already an existing free connection and pass it 
back. This will save you time, because the work which is needed to establish a 
vanilla connection isn't required.

A benchmark:
Using a persistent connection will allow you to establish ~47000 connections 
per second with PHP 5.3 (a real C program like libmysql will allow you to 
establish ~78000 connections) on a test system.
The same test without persistent connection: PHP is only able to create 1816 
connections per second and the C program only 1783 connections.

(Source: <http://www.phphatesme.com/blog/mysql/persistente-verbindungen/>)

So using persistent connection might save you time (btw: mysqli supports 
persistent connection since PHP 5.3), but cannot solve your current problem.

This article from 2002 is still actual:
<http://dev.mysql.com/news-and-events/newsletter/2002-11/a0000000086.html>


--
Regards,
Thomas


Reply via email to