Leaseweb / LswMemcacheBundle

Symfony bundle for Memcache Doctrine caching and session storage in the Web Debug Toolbar.
MIT License
202 stars 57 forks source link

ReflectionException #87

Open kironet opened 7 years ago

kironet commented 7 years ago

Hey, I have a problem with this bundle mb whole memcached. I have 2 websites that have Entity called Category. So If I restart memcached, one website stop working with this error>

Property Entity\Category::$name does not exist or Property Entity\Category::$title does not exist

Because one entity has $name second $title.

first website config:

tqd_memcache:
    session:
        pool: default
    pools:
        default:
            servers:
              - { host: localhost, tcp_port: 11211 }
            options:
                allow_failover: true
                max_failover_attempts: 20
                default_port: 11211
                chunk_size: 32768
                protocol: ascii
                hash_strategy: consistent
                hash_function: crc32
                redundancy: true
                session_redundancy: 2
                compress_threshold: 20000
                lock_timeout: 15

    doctrine:
        metadata_cache:
            pool: default
            entity_manager: default          # the name of your entity_manager connection
            document_manager: default        # the name of your document_manager connection
        result_cache:
            pool: default
            entity_manager: [default, read]  # you may specify multiple entity_managers
            prefix: "mactrh_result_"                # you may specify a prefix for the entries
        query_cache:
            pool: default
            entity_manager: default

second:

....
    doctrine:
        metadata_cache:
            pool: default
            entity_manager: default          # the name of your entity_manager connection
            document_manager: default        # the name of your document_manager connection
        result_cache:
            pool: default
            entity_manager: [default, read]  # you may specify multiple entity_managers
            prefix: "aresult_"                # you may specify a prefix for the entries
        query_cache:
            pool: default
            entity_manager: default

Is it possible to somehowe add prefix or something to let memcached recognize websites?

Thanks

kironet commented 7 years ago

Any ideas?....

mevdschee commented 7 years ago

I guess you need more prefixes.. Can you create a failing test case? I would be able to implement these extra prefix options for you.

NB: A workaround might be to start another memcached on another port and use that.