Explain the difference between optimistic locking and pessimistic locking.
Optimistic locking supposes no transaction conflict will occur and deals with the consequences if it does. Pessimistic locking supposes that conflict will occur and so stops it ahead of time with locks. In general, optimistic locking is preferred for the Internet and for many intranet applications.