Combining optimistic and pessimistic algorithms to process updates to replicas in a distributed system: a JAVA prototype