Skip to content

How to query and add atomically? #42

@romanzenka

Description

@romanzenka

I could not find an API which would do the following:

  1. start transaction
  2. bfcquery for resource X
  3. if absent, bfcadd X
  4. end transaction

I am afraid that I will run into race condition if two processes both query, both get negative result, then they both add at once.

Is there a way to remove a possibility of such a race condition?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions