Child pages
  • EOF-Using EOF-Optimistic Locking

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note that this section covers the locking strategy EOF uses at the databases layer as opposed to EOEditingContext locking which happens much higher in the stack. For information on EOEditingContext locking, please see Context and Database Locking.

There are two primary styles of locking that can be used with a database API: pessimistic and optimisic. Pessimistic locking actively prevents two participants from updating the same row by explicitly locking access to it when the first participant begins to make a change (effectively locking others out until the change is complete). Optimistic locking allows participants to make changes to the resources without an explicit lock, assuming success, and fails only if the changes actually cause a conflict. EOF takes the optimistic approach when locking data.