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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: indeyets at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2022 The PHP Group
All rights reserved.
Last updated: Tue Aug 09 19:04:05 2022 UTC