Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Tryton Tryton
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 790
    • Issues 790
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 77
    • Merge requests 77
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Tryton
  • TrytonTryton
  • Issues
  • #10870
Closed
Open
Created Oct 17, 2021 by Cédric Krier@cedOwner

Lock table is not enough to ensure to read last committed values

For now we lock tables during the execution of the code but as the doc explains it is not enough to ensure to read the latest values. Indeed we should lock the needed tables before any SELECT or UPDATE. The problem is that with the modularity and the OOP design of Tryton we do not know when starting the transaction which tables need to be locked.

I think a possible design would be to add an argument to Transaction.start as a list of tables to lock. Now when the backend is called to lock a table, it checks if it is a table already locked by the start of the transaction. If it is not than it raises an exception that is catched by the starter of the transaction which is responsible for adding the table to the list to lock when re-starting the transaction.

Those difficulty could be avoided by using SERIALIZABLE isolation. This mode is not available for now (we replaced by REPEATABLE READ) but maybe we could allow to declare the need for such transaction (maybe depending on the tables to lock) and in this case the LOCK calls and SELECT FOR could be ignored.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking