{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/data-fixtures/issues/42","labels_url":"https://api.github.com/repos/doctrine/data-fixtures/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/data-fixtures/issues/42/comments","events_url":"https://api.github.com/repos/doctrine/data-fixtures/issues/42/events","html_url":"https://github.com/doctrine/data-fixtures/issues/42","id":3321825,"number":42,"title":"Symfony2 fails to manage multiple connections and relationships between different bundles","user":{"login":"sibok","id":1386982,"avatar_url":"https://avatars.githubusercontent.com/u/1386982?v=3","gravatar_id":"","url":"https://api.github.com/users/sibok","html_url":"https://github.com/sibok","followers_url":"https://api.github.com/users/sibok/followers","following_url":"https://api.github.com/users/sibok/following{/other_user}","gists_url":"https://api.github.com/users/sibok/gists{/gist_id}","starred_url":"https://api.github.com/users/sibok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sibok/subscriptions","organizations_url":"https://api.github.com/users/sibok/orgs","repos_url":"https://api.github.com/users/sibok/repos","events_url":"https://api.github.com/users/sibok/events{/privacy}","received_events_url":"https://api.github.com/users/sibok/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/doctrine/data-fixtures/labels/Improvement","name":"Improvement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/doctrine/data-fixtures/milestones/3","html_url":"https://github.com/doctrine/data-fixtures/milestones/1.1","labels_url":"https://api.github.com/repos/doctrine/data-fixtures/milestones/3/labels","id":1032970,"number":3,"title":"1.1","description":"","creator":{"login":"lavoiesl","id":1216046,"avatar_url":"https://avatars.githubusercontent.com/u/1216046?v=3","gravatar_id":"","url":"https://api.github.com/users/lavoiesl","html_url":"https://github.com/lavoiesl","followers_url":"https://api.github.com/users/lavoiesl/followers","following_url":"https://api.github.com/users/lavoiesl/following{/other_user}","gists_url":"https://api.github.com/users/lavoiesl/gists{/gist_id}","starred_url":"https://api.github.com/users/lavoiesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavoiesl/subscriptions","organizations_url":"https://api.github.com/users/lavoiesl/orgs","repos_url":"https://api.github.com/users/lavoiesl/repos","events_url":"https://api.github.com/users/lavoiesl/events{/privacy}","received_events_url":"https://api.github.com/users/lavoiesl/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2015-03-22T20:21:04Z","updated_at":"2015-03-22T21:19:34Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2012-02-21T21:33:10Z","updated_at":"2015-03-22T21:21:17Z","closed_at":null,"body":"EDIT: Assetic has changed its path, so you can remove assetic tags from app/config/config.yml and app/config/config_dev.yml to get rid of the error.\r\n\r\nHi,\r\n\r\ni'm writting this thread in order to detail the full story about what's happening to me when working with multiple connections.\r\n\r\nI have an Oracle database which is accessed by OracleBundle through oracle connection, then i have a MySQL database which is accessed by MySQLBundle using mysql connection. Inside MySQLBundle i have an entity which tries to store, as FK, a field which belongs to another entity which resides inside OracleBundle. AFAIK it can't be done by Symfony2, but in the testing process and before linking each entity with each other, so there are no FK to link each entity, while creating the above ( http://www.2shared.com/file/2u4GhFVX/SymfonyTestCasetar.html ) \"project\" i noticed doctrine bundle can't manage multiple connections properly.\r\n\r\nWhat's happening to me when working with multiple connections? If you download the tar.gz file you could see there is a FooBundle and a BarBundle, each one using its own connection an of course each own entity manager. Inside FooBundle there is Foo entity and inside Bar Bundle there is Bar entity, each one has each fixture to load some info to the database. The issue i'm talking about appears here when trying to load the fixtures.\r\n\r\n**First i create both databases, each one using each own entity manage so also using each own connection:\r\nphp ./symfony doctrine:database:drop --connection=\"bar\" --force'\r\nphp ./symfony doctrine:database:drop --connection=\"foo\" --force'\r\nphp ./symfony doctrine:database:create --connection=\"bar\"\r\nphp ./symfony doctrine:database:create --connection=\"foo\"\r\n\r\n**Then i successfully create the schema:\r\nphp ./symfony doctrine:schema:create --em=\"bar\"\r\nphp ./symfony doctrine:schema:create --em=\"foo\"\r\n\r\n**And finally i try to load the fixtures which throughs me an error:\r\nphp ./symfony doctrine:fixtures:load --em=\"foo\"\r\nphp ./symfony doctrine:fixtures:load --em=\"bar\"\r\n\r\n**That's the error i get, so i think Symfony has some kind of bug:\r\nCreated database for connection named bar\r\nCreated database for connection named foo\r\nATTENTION: This operation should not be executed in a production environment.\r\n\r\nCreating database schema...\r\nDatabase schema created successfully!\r\nATTENTION: This operation should not be executed in a production environment.\r\n\r\nCreating database schema...\r\nDatabase schema created successfully!\r\n> purging database\r\n> loading myVendor\\myFooBundleBundle\\DataFixtures\\ORM\\Foo_\r\n> loading myVendor\\myBarBundleBundle\\DataFixtures\\ORM\\Bar_\r\n\r\n[Doctrine\\ORM\\Mapping\\MappingException]\r\nClass myVendor\\myBarBundleBundle\\Entity\\Bar is not a valid entity or mapped super class.\r\n\r\ndoctrine:fixtures:load [--fixtures[=\"...\"]] [--append] [--em=\"...\"] [--purge-with-truncate]\r\n\r\npurging database\r\nloading myVendor\\myFooBundleBundle\\DataFixtures\\ORM\\Foo_\r\n[Doctrine\\ORM\\Mapping\\MappingException]\r\nClass myVendor\\myFooBundleBundle\\Entity\\Foo is not a valid entity or mapped super class.\r\n\r\ndoctrine:fixtures:load [--fixtures[=\"...\"]] [--append] [--em=\"...\"] [--purge-with-truncate]\r\n\r\n**But if i randomly remove a fixture, no matter which one, everything runs fine:\r\nmv src/myVendor/myBarBundleBundle/DataFixtures/ORM/Bar.php /tmp/\r\nphp ./symfony doctrine:fixtures:load --em=\"foo\"\r\n> purging database\r\n> loading myVendor\\myFooBundleBundle\\DataFixtures\\ORM\\Foo\r\n\r\n**But when both fixtures exists:\r\nmv /tmp/Bar.php src/myVendor/myBarBundleBundle/DataFixtures/ORM/\r\nphp ./symfony doctrine:fixtures:load --em=\"foo\"\r\n> purging database\r\n> loading myVendor\\myFooBundleBundle\\DataFixtures\\ORM\\Foo\r\n> loading myVendor\\myBarBundleBundle\\DataFixtures\\ORM\\Bar_\r\n\r\n[Doctrine\\ORM\\Mapping\\MappingException]\r\nClass myVendor\\myBarBundleBundle\\Entity\\Bar is not a valid entity or mapped super class."},"comment":{"url":"https://api.github.com/repos/doctrine/data-fixtures/issues/comments/84708281","html_url":"https://github.com/doctrine/data-fixtures/issues/42#issuecomment-84708281","issue_url":"https://api.github.com/repos/doctrine/data-fixtures/issues/42","id":84708281,"user":{"login":"lavoiesl","id":1216046,"avatar_url":"https://avatars.githubusercontent.com/u/1216046?v=3","gravatar_id":"","url":"https://api.github.com/users/lavoiesl","html_url":"https://github.com/lavoiesl","followers_url":"https://api.github.com/users/lavoiesl/followers","following_url":"https://api.github.com/users/lavoiesl/following{/other_user}","gists_url":"https://api.github.com/users/lavoiesl/gists{/gist_id}","starred_url":"https://api.github.com/users/lavoiesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavoiesl/subscriptions","organizations_url":"https://api.github.com/users/lavoiesl/orgs","repos_url":"https://api.github.com/users/lavoiesl/repos","events_url":"https://api.github.com/users/lavoiesl/events{/privacy}","received_events_url":"https://api.github.com/users/lavoiesl/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T21:21:16Z","updated_at":"2015-03-22T21:21:16Z","body":"Having the ability to run each file in a transaction would fix this problem. However, a better solution would be to split fixtures by entitymanager, this could get complicated."}}