Does it need to communicate with the db server?

Regards,
Saša Stamenković


On Mon, May 24, 2010 at 8:32 PM, Hector Virgen <[email protected]> wrote:

> I think that's fine, quoteInto() should re-use the existing connection if
> it needs to communicate with the db server.
>
> --
> Hector
>
>
>
> On Mon, May 24, 2010 at 11:18 AM, Саша Стаменковић <[email protected]>wrote:
>
>> No, I'm not calling it twice, its handled by Zend_Application, as
>> recommanded by Zend, and showed in quick start.
>>
>> I'm not telling that there are more then one connections, but that
>> quoteInto communicates with mysql server in some way (executing some info
>> query for e.g.), otherwise, it should not fail in quote method.
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>> On Mon, May 24, 2010 at 7:25 PM, Hector Virgen <[email protected]>wrote:
>>
>>> If you call the factory method twice with the same parameters, will that
>>> create two connections? Саша, is it possible that somewhere in your code you
>>> are calling the factory method more than once to connect to your DB?
>>> Specifically Zend_Db::factory().
>>>
>>> --
>>> Hector
>>>
>>>
>>>
>>> On Mon, May 24, 2010 at 9:29 AM, Bill Karwin <[email protected]> wrote:
>>>
>>>> Each instance of Zend_Db_Adapter should never create more than one
>>>> connection.
>>>>
>>>> The _connect() method is a no-op if you are already connected.  It does
>>>> not create a new connection each time you use quoteInto().
>>>>
>>>> Calling getConnection() also returns the existing connection.  It
>>>> creates a new connection only if you weren't connected yet.  This is part 
>>>> of
>>>> the lazy-connection logic.
>>>>
>>>> Regards,
>>>> Bill Karwin
>>>>
>>>> On May 24, 2010, at 7:14 AM, Саша Стаменковић wrote:
>>>>
>>>> I'm asking because I see quote method in exception trace:
>>>>
>>>>
>>>> 2010-05-20T10:08:40+02:00 ERR (3): exception
>>>> 'Zend_Db_Adapter_Mysqli_Exception' with message 'User *** already has more
>>>> than 'max_user_connections' active connections' in
>>>> Zend/Db/Adapter/Mysqli.php:333
>>>> Stack trace:
>>>> #0 Zend/Db/Adapter/Abstract.php(832): Zend_Db_Adapter_Mysqli->_connect()
>>>> #1 Zend/Db/Adapter/Abstract.php(902):
>>>> Zend_Db_Adapter_Abstract->quote('582', NULL)
>>>> #2 Zend/Db/Select.php(1000):
>>>> Zend_Db_Adapter_Abstract->quoteInto('table...', '582', NULL)
>>>> #3 Zend/Db/Select.php(475): Zend_Db_Select->_where('table...', '582',
>>>> NULL, true)
>>>> ...
>>>>
>>>> Regards,
>>>> Saša Stamenković
>>>>
>>>>
>>>>
>>>
>>
>

Reply via email to