You are here

private function PdoSessionHandler::commit in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php \Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::commit()

Helper method to commit a transaction.

1 call to PdoSessionHandler::commit()
PdoSessionHandler::close in vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php

File

vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php, line 454

Class

PdoSessionHandler
Session handler using a PDO connection to read and write data.

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

private function commit() {
  if ($this->inTransaction) {
    try {

      // commit read-write transaction which also releases the lock
      if ('sqlite' === $this->driver) {
        $this->pdo
          ->exec('COMMIT');
      }
      else {
        $this->pdo
          ->commit();
      }
      $this->inTransaction = false;
    } catch (\PDOException $e) {
      $this
        ->rollback();
      throw $e;
    }
  }
}