merged fix for #873 from 0.10
This commit is contained in:
parent
223daae2ec
commit
45d41f1c9b
@ -222,7 +222,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
|
||||
|
||||
if ( ! $event->skipOperation) {
|
||||
try {
|
||||
$this->conn->getDbh()->beginTransaction();
|
||||
$this->_doBeginTransaction();
|
||||
} catch (Exception $e) {
|
||||
throw new Doctrine_Transaction_Exception($e->getMessage());
|
||||
}
|
||||
@ -292,7 +292,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
|
||||
|
||||
$listener->preTransactionCommit($event);
|
||||
if ( ! $event->skipOperation) {
|
||||
$this->conn->getDbh()->commit();
|
||||
$this->_doCommit();
|
||||
}
|
||||
$listener->postTransactionCommit($event);
|
||||
}
|
||||
@ -355,7 +355,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
|
||||
$this->_nestingLevel = 0;
|
||||
$this->_internalNestingLevel = 0;
|
||||
try {
|
||||
$this->conn->getDbh()->rollback();
|
||||
$this->_doRollback();
|
||||
} catch (Exception $e) {
|
||||
throw new Doctrine_Transaction_Exception($e->getMessage());
|
||||
}
|
||||
@ -401,6 +401,30 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
|
||||
{
|
||||
throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the rollback.
|
||||
*/
|
||||
protected function _doRollback()
|
||||
{
|
||||
$this->conn->getDbh()->rollback();
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the commit.
|
||||
*/
|
||||
protected function _doCommit()
|
||||
{
|
||||
$this->conn->getDbh()->commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Begins a database transaction.
|
||||
*/
|
||||
protected function _doBeginTransaction()
|
||||
{
|
||||
$this->conn->getDbh()->beginTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* removeSavePoints
|
||||
|
@ -65,4 +65,28 @@ class Doctrine_Transaction_Mssql extends Doctrine_Transaction
|
||||
|
||||
$this->conn->execute($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the rollback.
|
||||
*/
|
||||
protected function _doRollback()
|
||||
{
|
||||
$this->conn->getDbh()->exec('ROLLBACK TRANSACTION');
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the commit.
|
||||
*/
|
||||
protected function _doCommit()
|
||||
{
|
||||
$this->conn->getDbh()->exec('COMMIT TRANSACTION');
|
||||
}
|
||||
|
||||
/**
|
||||
* Begins a database transaction.
|
||||
*/
|
||||
protected function _doBeginTransaction()
|
||||
{
|
||||
$this->conn->getDbh()->exec('BEGIN TRANSACTION');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user