php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42766 PDO_Sqlite doesn't support transactions modes of SQlite
Submitted: 2007-09-26 11:14 UTC Modified: 2018-09-23 17:26 UTC
Votes:9
Avg. Score:4.6 ± 0.7
Reproduced:9 of 9 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (22.2%)
From: indeyets at gmail dot com Assigned:
Status: Open Package: PDO SQLite
PHP Version: 5.2.4 OS: unrelated
Private report: No CVE-ID: None
 [2007-09-26 11:14 UTC] indeyets at gmail dot com
Description:
------------
SQLite 3.0.8 and higher supports various transactions modes (DEFERRED, IMMEDIATE, EXCLUSIVE), but PDO's ->beginTransaction() doesn't take parameter, which would allow specifying this

see: http://sqlite.org/lang_transaction.html

Reproduce code:
---------------
$dbh = new Pdo();
$dbh->beginTransaction(PDO_Sqlite::IMMEDIATE);
// etc.
$dbh->commit();

Expected result:
----------------
immediate transaction starts

Actual result:
--------------
error, because beginTransaction doesn't support modes

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 21:13 UTC] jani@php.net
-Package: Feature/Change Request +Package: SQLite related
 [2015-04-04 17:49 UTC] cmb@php.net
-Package: SQLite related +Package: PDO SQLite
 [2016-02-03 17:12 UTC] i dot librarian dot software at gmail dot com
The beginTransaction() seems to only do deferred transactions. This situation is aggravated by the fact that one cannot do their own transactions using exec(). This will fail:

$dbHandler->exec("BEGIN EXCLUSIVE TRANSACTION");

It would be great if at least that was possible.
 [2018-09-23 17:26 UTC] cmb@php.net
> The beginTransaction() seems to only do deferred transactions.

Indeed, since deferred transactions are the default for SQLite3.

> It would be great if at least that was possible.

It seems to me that it is.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC