diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php index a14a83f077..7ffe2fd710 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -113,7 +113,7 @@ public static function open(array &$connection_options = []) { ]; try { - $pdo = new \PDO('sqlite:' . $connection_options['database'], '', '', $connection_options['pdo']); + $pdo = new PDOConnection('sqlite:' . $connection_options['database'], '', '', $connection_options['pdo']); } catch (\PDOException $e) { if ($e->getCode() == static::DATABASE_NOT_FOUND) { diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/PDOConnection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/PDOConnection.php new file mode 100644 index 0000000000..f93d69d5b3 --- /dev/null +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/PDOConnection.php @@ -0,0 +1,36 @@ +exec('BEGIN IMMEDIATE TRANSACTION') !== FALSE; + } + + /** + * {@inheritdoc} + */ + public function commit() { + return $this->exec('COMMIT') !== FALSE; + } + + /** + * {@inheritdoc} + */ + public function rollBack() { + return $this->exec('ROLLBACK') !== FALSE; + } + +}