Added new lock when persisting values to DB to avoid rest to zero being overwritten by an existing view