Comments (7)
Also names of connections may be not equal to names of entity managers
from stofdoctrineextensionsbundle.
Doctrine event managers are attached to the DBAL connections, not to the entity manager. So the name in the bundle config for the ORM is the name of the DBAL connection as stated in the doc.
And btw, your ORM config is bad. You should not register the same bundles for both entity managers as an entity cannot be managed by several entity managers (they would not share the changes done on the entities as they use separate UnitOfWork and so retrieving the same entity from both entity managers would give you different objects, which each one their changes and then a broken state when flushing.
from stofdoctrineextensionsbundle.
Ok, I've understood my problem.
You should not register the same bundles for both entity managers
Whan you can advice for me? FooTerritorialBundle
should have access to both connections.
from stofdoctrineextensionsbundle.
You need to separate the entities managed by both entity managers to different namespaces (as Doctrine registers the mapping by a folder). If you really need to put them in the same bundle, you will need to use different folders and register the mapping explicitly instead of relying on the auto-detection
from stofdoctrineextensionsbundle.
ah, and btw, you don't have 2 connections but 2 entity managers sharing the same DBAL connections (and so the same database). I don't really see the use case for such setup as this could be achieved using a single entity manager for the whole database, and it would probably be more efficient and easier to use.
from stofdoctrineextensionsbundle.
you don't have 2 connections but 2 entity managers sharing the same DBAL connections
This is for dev env only. In production there are 2 different DBAL connections.
from stofdoctrineextensionsbundle.
I've created two entity managers for replication: one connection for writing and some connection for writing. In dev env. only one connection shared between this two entity managers.
Sometimes I'm getting error message "Tree object class: UserArea must have tree metadata at this point" when getting user. When I change entity manager for getting this entity - it works correct.
AbstractArea - closure tree + STI
User has one UserArea
UserArea has one User and one child of AbstractArea.
What you can advice to me?
from stofdoctrineextensionsbundle.
Related Issues (20)
- Generated Repository classes break after 1.5.0 update HOT 2
- Argument 1 passed to Gedmo\Mapping\MappedEventSubscriber::loadMetadataForObjectClass
- ext_translations table not generated HOT 1
- Support php 8.0 HOT 9
- php8 compatibility HOT 2
- Integrity constraint violation HOT 1
- PHP Fatal error: Uncaught Error: Class 'Doctrine\Bundle\DoctrineExtensionsBundle\DoctrineExtensionsBundle' not found in /home/mciat/Software/api-yelo.eco/src/Kernel.php:25 HOT 1
- Undefined constant Doctrine\DBAL\Types\Type::<Insert constant coin here> HOT 2
- SoftDeleted entities are not filtered/excluded from database results HOT 1
- loggable and doctrine migrations
- [SoftDeletable] How to disable on entity getter HOT 2
- Sort error when using Repository functions HOT 1
- Next release ? HOT 4
- doctrine.event_subscriber is deprecated HOT 3
- Timestampable logic no longer works on 1.8.0 HOT 6
- Listeners not working HOT 3
- UnexpectedValueException: tree metadata HOT 7
- Allow the bundle to work without the annotation reader HOT 3
- Support Symfony 7, Switch doctrine suubscribers to #[AsDoctrineListener] HOT 1
- Support Symfony 7 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stofdoctrineextensionsbundle.