Skip to content

With manual transactions, race conditions on last_insert_rowid() need to be accounted for #21

@pydanny

Description

@pydanny

Race condition scenario with new configuration:

# pseudocode

# We insert the record here! 
db.insert(...)

# ! Record adding in different process increments the ROWID by another one

# Let's see the last PK, but now it's been incremented 0-to-many times
print(db.last_pk)

Probably not a fix

db.begin()
db.insert(...)
print(db.get_last_rowid()) # Not necessarily the record
db.commit()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions