Lock store before clearing or persisting