1. beginEdit() should always be followed by endEdit() or cancelEdit(). You don't need to use beginEdit/endEdit if you only change a single field in the record.
2. Don't call commit() if you are planning to save() the record (if the save is successful it will be commited). endEdit() will automatically call save() if autoSave:true.