DDC-3767: orm-alternative connection to use different database is working fine but then I have to use orm-default as a driver and not orm-alternative as driver while it should have been the other way. #4617

Open
opened 2026-01-22 14:46:03 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 12, 2015).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user OviMughal:

I needed to create module level database connection, I did override to orm-default and created orm-alternative connection but when using driver for it as orm-alternative, object manager instance is not created but when I use orm-default as driver everything works fine. But why?

Here is what is my config:
NOTE: if change orm_oz_default to orm-default on line #25, everything works fine.

return array(

  1. 'doctrine' => array(
  2.    'connection' => array(
    
  3.        'orm_oz_default' => array(
    
  4.          'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
    
  5.          'params' => array(
    
  6.               'host' => 'localhost',
    
  7.               'port' => '3306',
    
  8.               'user' => 'root',
    
  9.              'password' => '',
    
    1.                'dbname' => 'zfdocttwo',
      
    2.           )
      
    3.      )
      
    4.    ),
      
    5.    'entitymanager' => array(
      
    6.        'orm_oz_default' => array(
      
    7.            'connection' => 'orm_oz_default',
      
    8.        )
      
    9.    ),
      
    10.    'driver' => array(
      
    11.        'moduletwo_Entity' => array(
      
    12.            'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
      
    13.            'cache' => 'array',
      
    14.            'paths' => array(__DIR__.'/../src/Moduletwo/Entity')
      
    15.        ),
      
    16.        'orm_oz_default' => array(
      
    17.            'drivers' => array(
      
    18.                'Moduletwo\Entity' => 'moduletwo_Entity'
      
    19.            )
      
    20.        )
      
    21.    )
      
    22. ),
      32.);
Originally created by @doctrinebot on GitHub (Jun 12, 2015). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user OviMughal: I needed to create module level database connection, I did override to orm-default and created orm-alternative connection but when using driver for it as orm-alternative, object manager instance is not created but when I use orm-default as driver everything works fine. But why? Here is what is my config: NOTE: if change orm_oz_default to orm-default on line #25, everything works fine. return array( 1. 'doctrine' => array( 2. 'connection' => array( 3. 'orm_oz_default' => array( 4. 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', 5. 'params' => array( 6. 'host' => 'localhost', 7. 'port' => '3306', 8. 'user' => 'root', 9. 'password' => '', 1. 'dbname' => 'zfdocttwo', 2. ) 3. ) 4. ), 5. 'entitymanager' => array( 6. 'orm_oz_default' => array( 7. 'connection' => 'orm_oz_default', 8. ) 9. ), 10. 'driver' => array( 11. 'moduletwo_Entity' => array( 12. 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', 13. 'cache' => 'array', 14. 'paths' => array(__DIR__.'/../src/Moduletwo/Entity') 15. ), 16. 'orm_oz_default' => array( 17. 'drivers' => array( 18. 'Moduletwo\Entity' => 'moduletwo_Entity' 19. ) 20. ) 21. ) 22. ), 32.);
admin added the Bug label 2026-01-22 14:46:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4617