Integrating Locking and Optimistic Concurrency Control in Distributed Database Systems