| @@ 427-433 (lines=7) @@ | ||
| 424 | */ |
|
| 425 | public function transactionStart($transactionMode = false, $sessionCharacteristics = false) |
|
| 426 | { |
|
| 427 | if ($this->transactionNesting > 0) { |
|
| 428 | $this->transactionSavepoint('NESTEDTRANSACTION' . $this->transactionNesting); |
|
| 429 | } elseif ($this->connector instanceof SQLServerConnector) { |
|
| 430 | $this->connector->transactionStart(); |
|
| 431 | } else { |
|
| 432 | $this->query('BEGIN TRANSACTION'); |
|
| 433 | } |
|
| 434 | ++$this->transactionNesting; |
|
| 435 | } |
|
| 436 | ||
| @@ 456-462 (lines=7) @@ | ||
| 453 | } |
|
| 454 | ||
| 455 | --$this->transactionNesting; |
|
| 456 | if ($this->transactionNesting > 0) { |
|
| 457 | $this->transactionRollback('NESTEDTRANSACTION' . $this->transactionNesting); |
|
| 458 | } elseif ($this->connector instanceof SQLServerConnector) { |
|
| 459 | $this->connector->transactionRollback(); |
|
| 460 | } else { |
|
| 461 | $this->query('ROLLBACK TRANSACTION'); |
|
| 462 | } |
|
| 463 | return true; |
|
| 464 | } |
|
| 465 | ||
| @@ 473-480 (lines=8) @@ | ||
| 470 | return false; |
|
| 471 | } |
|
| 472 | --$this->transactionNesting; |
|
| 473 | if ($this->transactionNesting <= 0) { |
|
| 474 | $this->transactionNesting = 0; |
|
| 475 | if ($this->connector instanceof SQLServerConnector) { |
|
| 476 | $this->connector->transactionEnd(); |
|
| 477 | } else { |
|
| 478 | $this->query('COMMIT TRANSACTION'); |
|
| 479 | } |
|
| 480 | } |
|
| 481 | return true; |
|
| 482 | } |
|
| 483 | ||