Changeset 4057

Show
Ignore:
Timestamp:
03/20/08 15:11:33 (16 months ago)
Author:
romanb
Message:

Fixed #873

Location:
branches/0.10/lib/Doctrine
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Transaction.php

    r3884 r4057  
    203203                if ( ! $event->skipOperation) { 
    204204                    try { 
    205                         $this->conn->getDbh()->beginTransaction(); 
     205                        $this->_doBeginTransaction(); 
    206206                    } catch (Exception $e) { 
    207207                        throw new Doctrine_Transaction_Exception($e->getMessage()); 
     
    276276                    $listener->preTransactionCommit($event); 
    277277                    if ( ! $event->skipOperation) { 
    278                         $this->conn->getDbh()->commit(); 
     278                        $this->_doCommit(); 
    279279                    } 
    280280                    $listener->postTransactionCommit($event); 
     
    350350                $this->_internalNestingLevel = 0; 
    351351                try { 
    352                     $this->conn->getDbh()->rollback(); 
     352                    $this->_doRollback(); 
    353353                } catch (Exception $e) { 
    354354                    throw new Doctrine_Transaction_Exception($e->getMessage()); 
     
    396396    { 
    397397        throw new Doctrine_Transaction_Exception('Savepoints not supported by this driver.'); 
     398    } 
     399     
     400    /** 
     401     * Performs the rollback. 
     402     */ 
     403    protected function _doRollback() 
     404    { 
     405        $this->conn->getDbh()->rollback(); 
     406    } 
     407     
     408    /** 
     409     * Performs the commit. 
     410     */ 
     411    protected function _doCommit() 
     412    { 
     413        $this->conn->getDbh()->commit(); 
     414    } 
     415     
     416    /** 
     417     * Begins a database transaction. 
     418     */ 
     419    protected function _doBeginTransaction() 
     420    { 
     421        $this->conn->getDbh()->beginTransaction(); 
    398422    } 
    399423 
  • branches/0.10/lib/Doctrine/Transaction/Mssql.php

    r3884 r4057  
    6666        $this->conn->execute($query); 
    6767    } 
     68     
     69    /** 
     70     * Performs the rollback. 
     71     */ 
     72    protected function _doRollback() 
     73    { 
     74        $this->conn->getDbh()->exec('ROLLBACK TRANSACTION'); 
     75    } 
     76     
     77    /** 
     78     * Performs the commit. 
     79     */ 
     80    protected function _doCommit() 
     81    { 
     82        $this->conn->getDbh()->exec('COMMIT TRANSACTION'); 
     83    } 
     84     
     85    /** 
     86     * Begins a database transaction. 
     87     */ 
     88    protected function _doBeginTransaction() 
     89    { 
     90        $this->conn->getDbh()->exec('BEGIN TRANSACTION'); 
     91    } 
    6892}