generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logical lock for the_SEEDLOT #1308
Comments
RO from 32 |
RMCampos
added a commit
that referenced
this issue
Jul 26, 2024
Notes:
🤦 For an unknown reason, Hibernate is updating the Seedlot table twice. I'm working on it, to understand why and disable this feature/bug |
RMCampos
added a commit
that referenced
this issue
Jul 29, 2024
RMCampos
added a commit
that referenced
this issue
Jul 30, 2024
3 tasks
RMCampos
added a commit
that referenced
this issue
Jul 30, 2024
RMCampos
added a commit
that referenced
this issue
Jul 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the task
When updating SEEDLOT related data (i,e. child tables such a parent trees) it is a good idea to logically lock the SEEDLOT. For example, if two users are editing parent tree contribution and are unaware of one another, both could save their data (because the code is only looking at revision count on the parent tree records). The parent tree contribution could become a mess if that occurs. To prevent such issues it is typical to "touch" the seedlot record after all parent trees are updated. If the touch succeeds then commit everything and if it fails (0 rows updated) then rollback everything.
The touch is just
UPDATE seedlot
SET update_userid = :user
, update_timestamp = SYSTIMESTAMP
, revision_count = revision_count + 1
WHERE seedlot_number = :lot_number
AND revision_count = :revision_count_selected;
CC @ronrobb
Acceptance Criteria
The text was updated successfully, but these errors were encountered: