Optimistic locking assumes that no one would read or change the data while changes are being by a bean
Pessimistic locking would rather lock down the data so that no one can access it
or
In optimistic locking the row will not be locked until the actual update is performed. In order to prevent the lost update issue a version number column will be used. In pessimistic locking the row will be locked at the time when the data is selected from the database. This will prevent other users who want to update the same record. This should not prevent the readers but this behaviour varies from database to database.
No comments:
Post a Comment