How is it possible to use synchronized blocks in Servoy? For example, let us say there is an ATM system.
A user should only be allowed to withdraw money from the account after a check to see whether there are sufficient funds available. Hence, the checking of the account balance and withdrawal must happen together. Otherwise, if there are two people accessing the system at the same time, there is the possibility of the account being overdrawn.
To prevent this, we use synchronize blocks in Java so that only one person can access the code at a time.
What I want to know is, what is the method used in Servoy to implement similar functionality?
Thank you.
We tried to implement what you have suggested. But still it doesn’t seem to function the required way. The engineer who did this also made a seperate post on the forum as follows:
I developed a simple program to store the click count in a database table. Multiple users click “Click” the same button simultaneously. Then Program counts the number of clicks and store in the database table. Specific user’s clicks can be seen by clicking view clicks button.
Problem
User A clicks “Click” button 10 times and user B clicks “Click” button 10 times simultaneously. At the end, click count value which was stored in database table, should be 20. But the actual value is less than 20. When we check the user clicks, by clicking “view Click” button, then the number of clicks are correct for when totaled for both users.