This video discusses optimistic and pessimistic locking. When using optimistic concurrency, you do not acquire locks on objects and waits till commit time to see if there was another edit that conflicts. If there is a conflict you need to tell the user that you lost their work and they need to start over. When using pessimistic concurrency, you acquire locks on objects before allowing edits. This ensures that a user’s edits will never be lost but does require additional programming to handle situations where a user stars an edit and then leaves the session idle, preventing other users from editing the object.

Advertisements