"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/db/CDbTransaction.php" between
yii-1.1.23.445827.tar.gz and yii-1.1.24.a5ab20.tar.gz

About: Yii is a high-performance component-based PHP framework for developing large-scale Web applications. Hint: Yii 1.1 is now in maintenance mode.

CDbTransaction.php  (yii-1.1.23.445827):CDbTransaction.php  (yii-1.1.24.a5ab20)
skipping to change at line 64 skipping to change at line 64
/** /**
* Commits a transaction. * Commits a transaction.
* @throws CException if the transaction or the DB connection is not acti ve. * @throws CException if the transaction or the DB connection is not acti ve.
*/ */
public function commit() public function commit()
{ {
if($this->_active && $this->_connection->getActive()) if($this->_active && $this->_connection->getActive())
{ {
Yii::trace('Committing transaction','system.db.CDbTransac tion'); Yii::trace('Committing transaction','system.db.CDbTransac tion');
$this->_connection->getPdoInstance()->commit(); if($this->_connection->getPdoInstance()->inTransaction())
$this->_connection->getPdoInstance()->commit();
$this->_active=false; $this->_active=false;
} }
else else
throw new CDbException(Yii::t('yii','CDbTransaction is in active and cannot perform commit or roll back operations.')); throw new CDbException(Yii::t('yii','CDbTransaction is in active and cannot perform commit or roll back operations.'));
} }
/** /**
* Rolls back a transaction. * Rolls back a transaction.
* @throws CException if the transaction or the DB connection is not acti ve. * @throws CException if the transaction or the DB connection is not acti ve.
*/ */
public function rollback() public function rollback()
{ {
if($this->_active && $this->_connection->getActive()) if($this->_active && $this->_connection->getActive())
{ {
Yii::trace('Rolling back transaction','system.db.CDbTrans action'); Yii::trace('Rolling back transaction','system.db.CDbTrans action');
$this->_connection->getPdoInstance()->rollBack(); if($this->_connection->getPdoInstance()->inTransaction())
$this->_connection->getPdoInstance()->rollBack();
$this->_active=false; $this->_active=false;
} }
else else
throw new CDbException(Yii::t('yii','CDbTransaction is in active and cannot perform commit or roll back operations.')); throw new CDbException(Yii::t('yii','CDbTransaction is in active and cannot perform commit or roll back operations.'));
} }
/** /**
* @return CDbConnection the DB connection for this transaction * @return CDbConnection the DB connection for this transaction
*/ */
public function getConnection() public function getConnection()
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)