Changeset 4057
- Timestamp:
- 03/20/08 15:11:33 (16 months ago)
- Location:
- branches/0.10/lib/Doctrine
- Files:
-
- 2 modified
-
Transaction.php (modified) (4 diffs)
-
Transaction/Mssql.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/lib/Doctrine/Transaction.php
r3884 r4057 203 203 if ( ! $event->skipOperation) { 204 204 try { 205 $this-> conn->getDbh()->beginTransaction();205 $this->_doBeginTransaction(); 206 206 } catch (Exception $e) { 207 207 throw new Doctrine_Transaction_Exception($e->getMessage()); … … 276 276 $listener->preTransactionCommit($event); 277 277 if ( ! $event->skipOperation) { 278 $this-> conn->getDbh()->commit();278 $this->_doCommit(); 279 279 } 280 280 $listener->postTransactionCommit($event); … … 350 350 $this->_internalNestingLevel = 0; 351 351 try { 352 $this-> conn->getDbh()->rollback();352 $this->_doRollback(); 353 353 } catch (Exception $e) { 354 354 throw new Doctrine_Transaction_Exception($e->getMessage()); … … 396 396 { 397 397 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(); 398 422 } 399 423 -
branches/0.10/lib/Doctrine/Transaction/Mssql.php
r3884 r4057 66 66 $this->conn->execute($query); 67 67 } 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 } 68 92 }