Thanks for the answer.

I mostly agree with you.

I use Zend_Application and have only one adapter active, no legacy code,
which is visible in debug bar also (only one adapter listed). Also, I do not
set adapters in my models, everithing is done automaticly, only config file.

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

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'm trying to see the difference between
persistant and non persistant connection, since Zend_Db use non persistant
by default.

Regards,
Saša Stamenković


On Thu, May 20, 2010 at 12:33 PM, Thomas D. <[email protected]> wrote:

> Hi,
>
> Саша Стаменковић wrote:
> > I can have max 15 connections on this shared hosting.
> >
> > Because the connection I use is not persistanrt, but use pooling instead,
> > every query counts as new connection (not sure)?
>
> No!
>
> In your bootstrap, you set up an adapter
>
>  $db = Zend_Db::factory('Adapter', array(
>    // Options
>  );
>
> and set this as you default adapter for every Zend_Db_Table instance with
>
>  Zend_Db_Table::setDefaultAdapter($db);
>
> Maybe you are using Zend_Application, which will do this for you, but this
> is happening somewhere (or you are creating your Zend_Db_Table instance and
> set an adapter in the constructor, e.g. "$myTable = new
> MyZendTable(array('db' => $adapter));").
>
> So every time you are working with your database in the request, it will
> use the same adapter and therefore you are using the same connection.
>
>
> I guess the problem is, that 15 connections aren't enough. 15 connections
> would limit you application to 15 concurrent requests, if every request will
> use one connection (if you use more than one connection per request, e.g.
> you are also using legacy (=non ZF) code too, the number of concurrent
> requests might be lower).
>
> So you don't have a problem with ZF...
>
>
> --
> Regards,
> Thomas
>
>
>

Reply via email to