I work actually on a symfony2 project with MongoDB but I'm faced to a strange problem, when I want to submit some data in a form, symfony do a validation of these data but it loads an EntityManager so it tries to connect to a SQL server, obviously I got an error:
An exception occured in driver: SQLSTATE[28000] [1045] Blah Blah ...
The correct data_class is loaded for each form (example: My\Project\UserBundle\Document\User) so logicaly it will use the correct ObjectManager so DocumentManager for MongoDB but no...
The project I'm working on is separated on 3 web applications but work with the same database and have to manage MongoDB and others who orm can work with. So we have in dependencies a library which manages entities or documents with services/managers/etc.. like FosUserBundle for example. And this problem came when we implemented the library.
I tried different things if it was the namespace or because the document was in vendor so I inherited documents in children bundle but still the same problem.
Notice: Even FosUserBundle forms doesn't work anymore except the login (but it's symfony security part)
I don't have much code to share since I have totally no idea where is come from.
There is a way to force the ObjectManager to a form ? Or something else ?