The current connection is the last opened connection. In the next example we will show how you can get the current connection from the Doctrine_Manager instance:
// test.php
// ...
$conn2 = Doctrine_Manager::connection('mysql://username2:password2@localhost/test2', 'connection 2');
if ($conn2 === $manager->getCurrentConnection()) {
echo 'Current connection is the connection we just created!';
}