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

Hi, Adam.

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

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.

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