Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 May 2026 at 06:49 UTC
Updated:
22 May 2026 at 10:05 UTC
Jump to comment: Most recent
The database key value store ::setMultiple() inherits from the base class, which calls ::set() individually.
We could implement the method then wrap the parent method call in a transaction.
Separately I wonder whether this could use upsert() for multiple rows but that should probably be its own issue again.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
catchComment #4
mondrakeThis may mean transactions happening before full container is available, which itself may give headache in case we implement transaction events. But that’s another story.
The change itself is no brainer.
Comment #5
mondrakeComment #6
mondrakeThis is implemented (for individual rows) in #3586760: Use composite key Upsert queries in core.
Comment #7
alexpottCommitted and pushed d2f42dadfe7 to main and c648adcfce9 to 11.x. Thanks!
Comment #11
mondrake@catch I have pushed a commit in #3586760: Use composite key Upsert queries in core that uses UPSERT with multiple rows for setMultiple - that is atomic and removes the need for a transaction.