ZF-6828: __sleep of Zend_Db's Adapters
Description
__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...
Comments
Posted by old of Satoru Yoshida (yoshida@zend.co.jp) 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.