PDO\Sqlite: Add transaction mode attribute

php.internals

Samuel Štancl

1 year ago
Hi, I've opened a PR adding a new attribute to PDO\Sqlite: https://github.com/php/php-src/pull/19317 <https://github.com/php/php- src/pull/19317?notification_referrer_id=NT_kwDOAfgLhrQxNzkxMjcwMjYzOTozMzAzMzA5NA#issuecomment- 3176177745> 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.

Weedpacket

1 year ago
On 2025-08-12 07:35, Samuel Štancl wrote:
> Hi, I've opened a PR adding a new attribute to PDO\Sqlite: https:// > github.com/php/php-src/pull/19317 <https://github.com/php/php-src/ > pull/19317? > notification_referrer_id=NT_kwDOAfgLhrQxNzkxMjcwMjYzOTozMzAzMzA5NA#issuecomment-3176177745> >
As far as the form the attribute takes goes, an Enum with the values DEFERRED/IMMEDIATE/EXCLUSIVE would do the job. (As for calling it an attribute, I thought at first that what was being suggested was an Attribute, rather than a connection option.)

Samuel Štancl

1 year ago
By enums I'm assuming you mean PHP enums. That could work and would solve my issue of trying to represent the values of the attribute (only thing I'm not sure about is Pdo\SqliteTransactionMode being directly in the Pdo namespace). I've included a sample implementation in this comment <https://github.com/php/php-src/pull/19317#issuecomment- 3177353751> On August 12, 2025, Morgan <weedpacket@varteg.nz> wrote:

Samuel Štancl

362 days ago
Hi, Is there anything I could do here to get this reviewed before the 8.5 release? As mentioned earlier the proposed implementation should not be subject to the feature freeze. <https://github.com/php/php-src/pull/19317> Thank you. Samuel On August 12, 2025, "Samuel Štancl" <samuel@archte.ch> wrote:

Matteo Beccati

362 days ago
Hi Samuel, Il 04/09/2025 00:38, Samuel Štancl ha scritto:
> Hi, > > Is there anything I could do here to get this reviewed before the 8.5 > release? As mentioned earlier the proposed implementation should not be > subject to the feature freeze. > > https://github.com/php/php-src/pull/19317 <https://github.com/php/php- > src/pull/19317>
I think the 8.5 ship has sailed. Why should it not be subject to feature freeze? It surely is, unless the RMs approve it. Cheers
-- Matteo Beccati

Samuel Štancl

362 days ago
Hi Matteo, From reading earlier discussions my understanding is the feature freeze only applies to things that need RFCs. With PRs that add simple constants not necessarily needing an RFC. Personally I think the diff in the linked PR itself matches that description well, while the alternative implementation in the comment seems more likely to need an RFC. If I need RM approval how would I go about that. Email one of the RMs individually? Thank you. Samuel Štancl On September 4, 2025, Matteo Beccati <php@beccati.com> wrote:

Derick Rethans

362 days ago
On 4 September 2025 09:40:46 BST, "Samuel Štancl" <samuel@archte.ch> wrote:
>Hi Matteo, > >>From reading earlier discussions my understanding is the feature freeze >only applies to things that need RFCs. With PRs that add simple >constants not necessarily needing an RFC. > >Personally I think the diff in the linked PR itself matches that >description well, while the alternative implementation in the comment >seems more likely to need an RFC. > >If I need RM approval how would I go about that. Email one of the RMs >individually?
Flag the PR up to them by requesting a review from @release-managers cheers Derick Hi, Can you please not top-reply on this list? It's on our guidelines.