ZF-11677: CLONE - Zend_Application_Resource_Multidb with CacheManager doesn't cache

Issue Type: Bug Created: 2011-08-16T20:26:02.000+0000 Last Updated: 2012-06-10T10:48:13.000+0000 Status: Closed Fix version(s): Reporter: Eugene Istrati (eistrati) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Application_Resource

  • cache
  • multidb
  • zend

Related issues: Attachments:


I have configured Multidb with CacheManager as per documentation (see below). No errors in logs, full access to filesystem, everything should work like charm, the only problem is that no cache is created...

<pre class="highlight">
;1) CacheManager configuration: = Core
resources.cachemanager.database.frontend.customFrontendNaming = false
resources.cachemanager.database.frontend.options.lifetime = 7200
resources.cachemanager.database.frontend.options.automatic_serialization = true = File
resources.cachemanager.database.backend.customBackendNaming = false
resources.cachemanager.database.backend.options.cache_dir = APPLICATION_PATH "/../temp/cache"
resources.cachemanager.database.frontendBackendAutoload = false

;2) Multidb configuration:
resources.multidb.defaultMetadataCache = "database"

resources.multidb.db1.adapter = "pdo_mysql" = "localhost"
resources.multidb.db1.username = "webuser"
resources.multidb.db1.password = "XXXX"
resources.multidb.db1.dbname = "db1"
resources.multidb.db1.default = true

resources.multidb.db2.adapter = "pdo_pgsql" = ""
resources.multidb.db2.username = "dba"
resources.multidb.db2.password = "notthatpublic"
resources.multidb.db2.dbname = "db2"


Posted by Eugene Istrati (eistrati) on 2011-08-16T20:26:15.000+0000

Why this issue was closed? It is not fixed at all... I am expecting caching files to be created in APPLICATION_PATH "/../temp/cache", but instead it does nothing!

Posted by Ramon Henrique Ornelas (ramon) on 2011-08-16T21:38:08.000+0000

And I'm expected information more detailed, something this line see Also I wonder what was your error for the reproduction, Please try reproduced with this, but I need of a response of your reproduction.

Greetings Ramon

Posted by Eugene Istrati (eistrati) on 2011-08-17T15:25:16.000+0000


getBootstrap() ->setContainer(Zend\_Registry::getInstance()) ->bootstrap(); \_setupTable(); \_asserts(); function \_setupTable() { global $db1, $db2; $sql = 'CREATE TABLE zf11636(issue integer PRIMARY KEY);'; $multiDB = Zend_Registry::get('multidb'); $db1 = $multiDB->getDb('db1'); $db2 = $multiDB->getDb('db2'); _dropTable(); $db1->query($sql); $db2->query($sql); } function \_asserts() { global $db1, $db2; $cacheManager = Zend_Registry::get('cachemanager'); $cache = $cacheManager->getCache('database'); $tableDb1 = new Zend_Db_Table(array('db' => $db1, 'name' => 'zf11636')); $tableDb2 = new Zend_Db_Table(array('db' => $db2, 'name' => 'zf11636')); // caching metadata $cache->clean(Zend_Cache::CLEANING_MODE_ALL); $tableDb1->info(Zend_Db_Table::COLS); $tableDb2->info(Zend_Db_Table::COLS); assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 1); assert(Zend_Db_Table::getDefaultMetadataCache() == $cache); assert(4 == iterator_count(new RecursiveDirectoryIterator("./temp/cache"))); $cache->clean(Zend_Cache::CLEANING_MODE_ALL); _dropTable(); } function \_dropTable() { global $db1, $db2; try { $db1->query('DROP TABLE zf11636'); } catch (Exception $e) { } try { $db2->query('DROP TABLE zf11636'); } catch (Exception $e) { } } THIS IS THE OUTPUT THAT I AM SEEING: Warning: assert(): Assertion failed in C:\\Eugene\\localhost\\Billing\\testing.php on line 70 Call Stack: 0.0098 357832 1. {main}() C:\\Eugene\\localhost\\Billing\\testing.php:0 0.2185 5536704 2. \_asserts() C:\\Eugene\\localhost\\Billing\\testing.php:34 0.2543 5545536 3. assert() C:\\Eugene\\localhost\\Billing\\testing.php:70 Posted by Ramon Henrique Ornelas (ramon) on 2011-08-19T02:05:51.000+0000 @Eugene Thanks by your response ;). I did change in script added constant _DIR\_CACHE_, change to your directory cache. The expected of your feedback ;). Since already thank you. Greetings Ramon Posted by Eugene Istrati (eistrati) on 2011-08-21T16:50:53.000+0000 Sure! Please give me couple of days as I'm now traveling and will be back soon... Posted by BenoƮt Durand (intiilapa) on 2011-08-21T19:00:57.000+0000 Please use tag code : this improves the reading. Posted by Eugene Istrati (eistrati) on 2011-08-22T20:55:49.000+0000 Same thing:
    Warning: assert(): Assertion failed in C:\Eugene\localhost\Billing\testing.php on line 72



Posted by Ramon Henrique Ornelas (ramon) on 2011-11-22T09:22:46.000+0000

Sorry the delay to response. But I was really busy. You can verify the dir\_cache is writable (is\_writable) or simulate in another enviroment to verify the diff (if this fine work).

Greetings Ramon



Posted by Ramon Henrique Ornelas (ramon) on 2012-06-10T10:48:13.000+0000

Need of more information about last comment. Case persist this problem feel free to reopen ;).

Greetings, Ramon




Have you found an issue?

See the Overview section for more details.


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

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