SwitchingbetweenconnectionsinDoctrineisveryeasy,youjustcallDoctrine_Manager::setCurrentConnection()method.YoucanaccesstheconnectionbycallingDoctrine_Manager::getConnection()orDoctrine_Manager::getCurrentConnection()ifyouonlywanttogetthecurrentconnection.<codetype="php">// Doctrine_Manager controls all the connections $manager=Doctrine_Manager::getInstance();// open first connection$conn=$manager->openConnection(newPDO('dsn','username','password'),'connection 1');// open second connection$conn2=$manager->openConnection(newPDO('dsn2','username2','password2'),'connection 2');$manager->getCurrentConnection();// $conn2$manager->setCurrentConnection('connection 1');$manager->getCurrentConnection();// $conn// iterating through connectionsforeach($manageras$conn){}</code>