You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With concurrent sessions we are likely to read data and have it become stale later on. When we have highly independent and isolated sessions then we can't easily notify these sessions when their data has gone stale. One way to solve this, is to simply add a version to the database tables. When you go to update a value we can check the table version and if there is a mismatch then read the new value and update again. Each update then gives a new table version. This can just be done for the tables where you expect you'll will need to read and update concurrently and avoid putting this extra work on tables you won't concurrently update.
With concurrent sessions we are likely to read data and have it become stale later on. When we have highly independent and isolated sessions then we can't easily notify these sessions when their data has gone stale. One way to solve this, is to simply add a version to the database tables. When you go to update a value we can check the table version and if there is a mismatch then read the new value and update again. Each update then gives a new table version. This can just be done for the tables where you expect you'll will need to read and update concurrently and avoid putting this extra work on tables you won't concurrently update.
Here is an example of how to do this in SQLAlchemy.
https://docs.sqlalchemy.org/en/13/orm/versioning.html
The text was updated successfully, but these errors were encountered: