Trac
Ticket #873: Transaction.php.patch
| File Transaction.php.patch, 2.1 kB (added by zomg, 5 months ago) |
|---|
Patch for Doctrine/Transaction.php |
-
.
old new 202 202 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()); 208 208 } … … 217 217 } 218 218 219 219 /** 220 * Actually begins the transaction. 221 */ 222 protected function doBeginTransaction() 223 { 224 $this->conn->getDbh()->beginTransaction(); 225 } 226 /** 220 227 * commit 221 228 * Commit the database changes done during a transaction that is in 222 229 * progress or release a savepoint. This function may only be called when … … 275 282 276 283 $listener->preTransactionCommit($event); 277 284 if ( ! $event->skipOperation) { 278 $this-> conn->getDbh()->commit();285 $this->doCommit(); 279 286 } 280 287 $listener->postTransactionCommit($event); 281 288 } … … 291 298 292 299 return true; 293 300 } 301 302 /** 303 * Actually performs the commit 304 */ 305 protected function doCommit() 306 { 307 $this->conn->getDbh()->commit(); 308 } 294 309 295 310 /** 296 311 * rollback … … 349 364 $this->_nestingLevel = 0; 350 365 $this->_internalNestingLevel = 0; 351 366 try { 352 $this-> conn->getDbh()->rollback();367 $this->doRollback(); 353 368 } catch (Exception $e) { 354 369 throw new Doctrine_Transaction_Exception($e->getMessage()); 355 370 } … … 362 377 } 363 378 364 379 /** 380 * Performs the actual rollback 381 */ 382 protected function doRollback() 383 { 384 $this->conn->getDbh()->rollback(); 385 } 386 387 /** 365 388 * releaseSavePoint 366 389 * creates a new savepoint 367 390 *