1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Cloning and configuring the cache adapter for each newly created cache region (fixes cache namespacing)

This commit is contained in:
Marco Pivetta 2015-01-15 21:17:49 +01:00
parent 6564f95260
commit 0f2c117f3e

View File

@ -198,7 +198,11 @@ class DefaultCacheFactory implements CacheFactory
return $this->regions[$cache['region']];
}
$region = new DefaultRegion($cache['region'], clone $this->cache, $this->regionsConfig->getLifetime($cache['region']));
$cacheAdapter = clone $this->cache;
$cacheAdapter->setNamespace($cache['region']);
$region = new DefaultRegion($cache['region'], $cacheAdapter, $this->regionsConfig->getLifetime($cache['region']));
if ($cache['usage'] === ClassMetadata::CACHE_USAGE_READ_WRITE) {