Issues

ZF-10447: Paginator and cache

Issue Type: Bug Created: 2010-09-14T02:43:31.000+0000 Last Updated: 2012-05-05T02:32:44.000+0000 Status: Closed Fix version(s): Reporter: Ionut Dinu (tunder) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Paginator

Related issues: - ZF-11318

Attachments:

Description

Hi all. I'll be brief.

First problem: please see my last comment at http://framework.zend.com/issues/browse/ZF-6989 because that problem is still on even if the task is closed.

The second problem:

<pre class="highlight">
protected function _getCacheInternalId()
{
    return md5(serialize(array(
        $this->getAdapter(), $this->getItemCountPerPage())));
}

is a bad ideea. By serializing the paginator adapter the db adapter calls __sleep which sets the isConnected flag to false. The next call to the db makes a new connection to the db and [this is what happened to me] can loose any temporary tables i created. The answer to this problem is fixing the first one.

Comments

Posted by Ionut Dinu (tunder) on 2010-09-14T02:43:57.000+0000

example:

\_DB\_HOST, 'port' => \_DB\_PORT, 'username' => \_DB\_USERNAME, 'password' => \_DB\_PASSWORD, 'dbname' => \_DB\_DATABASE, 'profiler' => \_DB\_PROFILER )); $db->query(" CREATE TEMPORARY TABLE `some_table` ( `id` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); $db->query(" INSERT INTO some\_table SET id = 5 "); $select = new Zend\_Db\_Select($db); $select->from('a')->setIntegrityCheck(false)->joinLeft('some\_table', 'a.id = some\_table.id'); $paginator = new Zend\_Paginator::factory($select); $paginator->setCacheEnabled(true)->setCache($cache); /\*\* \* by rendering the paginator in the view the temporary table is not know amymore. \*/

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts