added test case for optimistic lock