Problem/Motivation

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.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3588385

Command icon Show commands

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

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

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

mondrake’s picture

mondrake’s picture

I wonder whether this could use upsert() for multiple rows but that should probably be its own issue again.

This is implemented (for individual rows) in #3586760: Use composite key Upsert queries in core.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed d2f42dadfe7 to main and c648adcfce9 to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed c648adcf on 11.x
    perf: #3588385 Add a transaction around the database key value store...

  • alexpott committed d2f42dad on main
    perf: #3588385 Add a transaction around the database key value store...
mondrake’s picture

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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.