Put optimistic concurrency around the save function