0 votes
in Integrations by

1 Answer

+1 vote
selected by anonymous
Best answer
Optimistic locking is based on the optimistic scenario that there will be very minimal chance of someone else changing the same set of data while another user is making changes to it, so in essence the initial data is allowed to be processed by two or more than two users simultaneously and at the time of committing it is checked that the initial set of data from which we started is same or not, if it is same no issues else, the data is reloaded from the new source of truth and then users current changes  are discarded and he/she has to start afresh.

Pessimistic locking on the other hand does not allow anyone else to start making changes to the same set of data if someone else has already started and hence taken a lock on it.

For optimistic locking In BPM you can rely on the database to give you a version number for the initial set of data and check before submitting that the current version number is same as what you started with otherwise discard current changes and load the latest set of data.

For pessismistic locking the database issues a lock and we can check upfront if a lock exists or not and give the user appropriate message.

Another approach is to use shared business objects without relying on the db to give you a version number, version numbers and previous versions of the shared business objects can be loaded with api calls.

Related questions

0 votes
0 answers 112 views
0 votes
0 answers 162 views
0 votes
1 answer 339 views
0 votes
1 answer 521 views
0 votes
0 answers 465 views
+1 vote
2 answers 1.8k views

586 questions

483 answers


1.7k users

Dosvak IBM BPM /BAW Products, Download Evaluation
Process & Performance Tools Process & Performance Tools
Code Analyzer Code Analyzer
UI Toolkit UI Toolkit
Integration Monitoring Integration Monitoring
Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel