Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128446 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 8D2181A00BC for ; Mon, 11 Aug 2025 19:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754940806; bh=WVUNaA2/4tnSzYYam5BJVGJ5KGYEWZARkelqgDnxzrc=; h=Date:From:To:Subject:From; b=feeYKrJEeVeBGkIKy7ItUCWQqrxJ36k9grrf1jgR4xr7OVmg5bGpngo/kSYpFtf+u WECNZq0u+FIDQfxSRyVYlXkNxbDGRm6jcjKG/rFCfDpUxqT2HMYAShF4jZEoQA/xlV o/BM2GcX5GQH/pe0uLzSkcvaw7Ip+jfWkVo0NmNKvIWbh2n1EXwJj/PIoiVxrxLueD RkvSOXX/67izN6sYduN/Trs3rz9o9lkWh0p14c9ad7Ge7SF+phvfZZHkOACBo8HuKr f76Yw20TFdzmBgt4V6qfAQ8WldpQahZTDYwDOJERmc8HhsSXNElcQ25NW+xKP5ApzG XzuAMCFGIk04g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 19ED818004D for ; Mon, 11 Aug 2025 19:33:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from 01b.hosted.hey.com (01b.hosted.hey.com [204.62.114.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 11 Aug 2025 19:33:24 +0000 (UTC) Received: from hey.com (bigip-vip.rw-ash-int.37signals.com [10.20.0.24]) by 01.hosted.hey.com (Postfix) with ESMTP id 3490883D8F for ; Mon, 11 Aug 2025 19:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archte.ch; s=heymail; t=1754940902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CBL7KIZDtQVly/64iBBho7g0ZP+glktAjha8INX/+FM=; b=CVwL/dWpUn5+Z3y1C06Khr0sTAnIoVFwFv62o+cpWx9KbrUH3rbMJATjPFfnilWbt4vQoB yuGQcSFb7I0wr8kMmcyzv6q7vDVS+ZUKlNGMuKGa7U+L9LA/T3FjUDMaKgN/mOKfJNz3Vy HN3dmgPV5YtVMAsHUwLbAUrOlVzxJ5PUqqEh/j/SQVpcq5zIf4X97rYp69+DeNUqMAYo8U MIg2iYN0EiFQdCn4QhQdUOqSJGDeLsqmqV+aWQfKJ2YL1O1aSNIn/QGc8QcNNXoab0P79u FvLh6zDn3IPSz8WcbtCchduv/kG13xUtAuJb+B3bnIHqZEikQmtxCgu+Ly2fgQ== Date: Mon, 11 Aug 2025 21:35:01 +0200 To: internals@lists.php.net Message-ID: Subject: [PHP-DEV] PDO\Sqlite: Add transaction mode attribute Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_689a45e61876b_8d2012015139a"; charset=UTF-8 Content-Transfer-Encoding: 7bit From: samuel@archte.ch (=?UTF-8?B?U2FtdWVsIMWgdGFuY2w=?=) ----==_mimepart_689a45e61876b_8d2012015139a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, I've opened a PR adding a new attribute to PDO\Sqlite: https://github.com/php/php-src/pull/19317 The change is explained in depth in the PR, but in short, it makes it possible to use immediate/exclusive transaction modes, rather than the default deferred mode, when using $pdo->beginTransaction(). Deferred mode has this particular behavior where if your transaction first reads before writing, it will only wait for other transactions to finish while acquiring the initial shared lock. Then when it tries to upgrade to a write lock it just immediately aborts with SQLITE_BUSY, regardless of your busy_timeout setting. This is a real pain point with using SQLite in production. I've addressed it by adding a new attribute that changes how the PDO driver begins the transaction. Is my understanding correct that this doesn't need an RFC? And if that's the case, is this PR not subject to the PHP 8.5 feature freeze happening this week? The changes are pretty basic so I'd appreciate any reviews that could move this forward. Would love for this to land in PHP 8.5. ----==_mimepart_689a45e61876b_8d2012015139a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, I've opened a PR adding a new attribute to PDO\Sqlite: ht= tps://github.com/php/php-src/pull/19317

The change is explaine= d in depth in the PR, but in short, it makes it possible to use immediate= /exclusive transaction modes, rather than the default deferred mode, when= using $pdo->beginTransaction(). Deferred mode has this particular beh= avior where if your transaction first reads before writing, it will only = wait for other transactions to finish while acquiring the initial shared = lock. Then when it tries to upgrade to a write lock it just immediately a= borts with SQLITE_BUSY, regardless of your busy_timeout setting.

T= his is a real pain point with using SQLite in production. I've addres= sed it by adding a new attribute that changes how the PDO driver begins t= he transaction.

Is my understanding correct that this doesn't = need an RFC? And if that's the case, is this PR not subject to the PH= P 8.5 feature freeze happening this week?

The changes are pretty b= asic so I'd appreciate any reviews that could move this forward. Woul= d love for this to land in PHP 8.5.
----==_mimepart_689a45e61876b_8d2012015139a--