As shown blow,sometime,the elements of embedded array comments will be modified,or an new comment will be inserted into comments as first element,and when these modifications happen,I want to lock something in minimal scope to avoid nasty issue,questions are:
1,What scope to lock is appropriate?
2,How to lock?
{
name: 'Me',
comments: [{
"author": "Joe S.",
"text": "I'm Thirsty"
},
{
"author": "Adder K.",
"text": "old content"
}]
}