Whenever you are working with SSOM and you are updating any information in the content database using SSOM code, SharePoint will not allow you until and unless you have not set AllowUnsafeUpdates property to True. Once the value is updated you can again set it to False.