Index: Db/Adapter/Abstract.php =================================================================== --- Db/Adapter/Abstract.php (Revision 3715) +++ Db/Adapter/Abstract.php (Arbeitskopie) @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Db - * @subpackage Adapter + * @subpackage Adapte * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -69,6 +69,13 @@ protected $_connection = null; /** + * open Transaction count + * + * @var integer + */ + protected $_openTransactions = 0; + + /** * Constructor. * * $config is an array of key/value pairs containing configuration @@ -131,6 +138,16 @@ } /** + * Returns the actual count of open transactions + * + * @return integer + */ + public function getOpenTransactionCount() + { + return $this->_openTransactions; + } + + /** * Prepares and executes an SQL statement with bound data. * * @param string|Zend_Db_Select $sql The SQL statement with placeholders. @@ -169,6 +186,7 @@ $q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION); $this->_beginTransaction(); $this->_profiler->queryEnd($q); + $this->_openTransactions++; return true; } @@ -183,6 +201,7 @@ $q = $this->_profiler->queryStart('commit', Zend_Db_Profiler::TRANSACTION); $this->_commit(); $this->_profiler->queryEnd($q); + $this->_openTransactions--; return true; } @@ -197,6 +216,7 @@ $q = $this->_profiler->queryStart('rollback', Zend_Db_Profiler::TRANSACTION); $this->_rollBack(); $this->_profiler->queryEnd($q); + $this->_openTransactions--; return true; }