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
TBD: Use optimistic locking in the expiration job, i.e., update only records with PENDING status on the DB level.
Test:
Initiate operation approval (can be simulated with update of the status in the DB)
Run the job expiration job.
The sessions should get locked depending on the commit setting. But approved operation cannot be marked as Expired.
The text was updated successfully, but these errors were encountered:
Mind that in case of optimistic locking, most probably we should set spring.jpa.properties.hibernate.batch_versioned_data=true for batch processing. For testing, we may use spring.jpa.properties.hibernate.generate_statistics=true.
I'm leaving it open on purpose. But the optimistic locking like: update pa_operation set status = 3 where status = 1 and id in (...) is fine, and ensure that the approved operation is not expired by any racing conditions.
I would rather avoid the versioning column in the table. This would be more complicated and cannot bring better results than previously mentioned update.
TBD: Use optimistic locking in the expiration job, i.e., update only records with PENDING status on the DB level.
Test:
Initiate operation approval (can be simulated with update of the status in the DB)
Run the job expiration job.
The sessions should get locked depending on the commit setting. But approved operation cannot be marked as Expired.
The text was updated successfully, but these errors were encountered: