Explain the difference between optimistic and pessimistic locking, and when you would use each in a scheduling database.