Answer the question
In order to leave comments, you need to log in
Are there any peculiarities of how Doctrine works in long-lived applications?
I'm very interested in the answer to this question - Are there any peculiarities when working with Doctrine in a long-lived application?
There is a consumer who listens to the queue, when he receives something, he writes it to the database.
Before recording, it periodically makes queries to the database for reference information.
So, I spotted a feature. If the data in the database is changed by an SQL query, then the doctrine manager does not see this.
He seems to be ignoring the database. He does not see this changed data.
After restarting the consumer everything is ok.
How can this be?
The consumer lacks a parameter of some kind?
Or it is necessary to recreate connection before each request?
Who - niyuud faced similar?
Answer the question
In order to leave comments, you need to log in
How can this be?
$em->clear()
Sometimes you want to clear the identity map of an EntityManager to start over. We use this regularly in our unit-tests to enforce loading objects from the database again instead of serving them from the identity map. You can call EntityManager#clear() to achieve this result.
https://www.doctrine-project.org/projects/doctrine...
The consumer lacks a parameter of some kind?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question