ZF-6828: __sleep of Zend_Db's Adapters

Issue Type: Bug Created: 2009-05-27T17:37:25.000+0000 Last Updated: 2011-02-18T08:18:14.000+0000 Status: Resolved Fix version(s): Reporter: Adam Kusmierz (raistlin) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db

Related issues: Attachments:


__sleep() method of class Zend_Db_Adapter_* mustn't finish connection to DB ($this->_connection = false;).

Think about serialization of for example the Zend_Paginator (for caching it in other way than Zend_Paginator::setCache() do). If we'll serialize Zend_Paginator (which used Zend_Paginator_Adapter_DbSelect), we serialize Zend_Db_Adapter too. So we disconnect connection from a database. Next call to any Zend_Db_* (with lazy connection) creates new connection...


Posted by old of Satoru Yoshida ( on 2009-05-30T19:50:56.000+0000

Hi, Adam.

Probably, you may also need __wakeup() method for unserialization , I think.

Posted by Adam Kusmierz (raistlin) on 2009-05-31T07:10:52.000+0000

Yeah, but this isn't a problem. The problem is that you have disconnected DB (if you serializing any of Zend_Db's object) - and you connect again when you unserialize it.

Posted by Ralph Schindler (ralph) on 2011-02-18T08:18:13.000+0000

I am having trouble understanding the use case. Please reopen with some short reproduction case that demonstrates the issue you are having.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.