Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine cache unrecognized options error

I'm using the following options in order to activate the cache for doctrine in Symfony2:

doctrine:
    dbal:
        ...
    orm:
        default_entity_manager: default
        ...
        metadata_cache_driver: apc
        query_cache_driver: apc
        result_cache_driver: apc

But I'm getting the following error message:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized options "metadata_cache_driver, query_cache_driver, result_cache_driver" under "doctrine.orm"

I'm using the following versions:

doctrine/cache: v1.4.1

doctrine/common: v2.5.0

doctrine/dbal: v2.4.4

symfony/symfony: v2.6.11

Any suggestions?

like image 736
rfc1484 Avatar asked Sep 01 '15 13:09

rfc1484


1 Answers

If you have more than one Entity Manager configured under entity_managers section of your config.yml then you need to configure these options separately for each Entity Manager:

doctrine:
    orm:
        default_entity_manager: default
        entity_managers:
            default:
                ...
                metadata_cache_driver: apc
                query_cache_driver: apc
                result_cache_driver: apc
            another_entity_manager:
                ...
                metadata_cache_driver: apc
                query_cache_driver: apc
                result_cache_driver: apc
like image 136
Tomasz Madeyski Avatar answered Oct 05 '22 10:10

Tomasz Madeyski