Secured DB syncing. Not allowing changes while syncing