<?php$sess=$manager->openSession(Doctrine_DB::getConnection("schema://username:password@hostname/database"));// get session state:switch($sess):caseDoctrine_Session::STATE_BUSY:// multiple open transactionsbreak;caseDoctrine_Session::STATE_ACTIVE:// one open transactionbreak;caseDoctrine_Session::STATE_CLOSED:// closed statebreak;caseDoctrine_Session::STATE_OPEN:// open state and zero open transactionsbreak;endswitch;// getting database handler$dbh=$sess->getDBH();// flushing the session$sess->flush();// print lots of useful info about session:print$sess;?>