# PDO\Sqlite: Add transaction mode attribute

- Thread: https://externals.io/message/128446
- Original archive: https://news-web.php.net/php.internals/128446
- Started by samuel@archte.ch on 2025-08-11T19:35:01+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #128446 — samuel@archte.ch — 2025-08-11T19:35:01+00:00

URL: https://externals.io/message/128446#128446

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.

---

## #128447 — Morgan — 2025-08-11T23:13:00+00:00

URL: https://externals.io/message/128446#128447 · In reply to: #128446

> 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.)

---

## #128448 — samuel@archte.ch — 2025-08-12T01:07:51+00:00

URL: https://externals.io/message/128446#128448 · In reply to: #128447

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>


> 
> > […]
> src/> 
> > […]
> 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.)

---

## #128621 — samuel@archte.ch — 2025-09-03T22:38:27+00:00

URL: https://externals.io/message/128446#128621 · In reply to: #128448

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


> 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>
>
> 
> > […]
>
>
>
> > […]

---

## #128625 — Matteo Beccati — 2025-09-04T07:06:15+00:00

URL: https://externals.io/message/128446#128625 · In reply to: #128621

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

---

## #128630 — samuel@archte.ch — 2025-09-04T08:40:46+00:00

URL: https://externals.io/message/128446#128630 · In reply to: #128625

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


> Hi Samuel,
>
> Il 04/09/2025 00:38, Samuel Štancl ha scritto:
> > […]
> 8.5 
> > […]
> be 
> > […]
> <https://github.com/php/php- 
> > […]
>
> 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

---

## #128631 — Derick Rethans — 2025-09-04T10:25:26+00:00

URL: https://externals.io/message/128446#128631 · In reply to: #128630

>Hi Matteo,
>
> > […]
>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.
