Skip to content

Store concurrency improvements #1596

@mjuchli-da

Description

@mjuchli-da

In StoreSql.setTransaction we do getTransaction() then insertInto(). Under concurrency, two callers can both pass the existence check and one will hit a DB uniqueness error. That’s fine functionally, but:

  • the thrown error will likely be a raw DB error, not the nice "already exists" message
  • it’s better to enforce "insert-only" at the DB layer (e.g., INSERT ... ON CONFLICT DO NOTHING/RAISE) and map to a consistent error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions