corridor/sqlalchemy-history

Relationships expect transaction-id is in ascending order

Closed this issue · 0 comments

In some DBs, the primary keys are not ascending always.

For example:

If there are multiple connections trying to write to the DB- each connection is allocated some IDs and so their order of writing.
For example:

  • conn1 is allocated sequence values 11 to 20
  • conn2 is allocated sequence values 21 to 30
  • conn1 writes id=11
  • conn2 writes id=21
  • conn1 writes id=12

So, the assumption that the Transaction ID will always be chronological - is wrong.