> > Let say the user "A" create the question "What is car?", the user "B" saw > "What is car?" question and start to answer "Car is ....". But before user > "B" submitting the answer, a user "A" modified the question to "What is > bicycle?". >
I see, well you can still use optimistic locking to make sure that user B sees the updated question before the answer will be submitted. When loading the page just load the version of the question and send it back when submitting an answer. Before saving the answer you can now check if the version of the question has been updated in the mean time and then react to it. Your Stackoverflow example is possibly the hardest you could have picked because Stackoverflow deals with free text (question and answers) and it is pretty hard for software to get the meaning of these texts and then try to ensure that they stay consistent. I think Stackoverflow already does the best it can do: whenever you edit your question a new version of that question will be saved and you can track all the edits of a question. A slight enhancement could be to indicate at each answer for which version of a question this answer has been made and provide some UI controls to show that version of the question. At the end it all comes down to how your app should behave and the data you are dealing with. If you need consistency and you can check for consistency then check it. If you want consistency but you can not check for it reliably (like in the stackoverflow example) then provide tools for the user so that the user can make the data consistent again. Or depending on your requirements you can create consistent versions of your data and provide some UI so that the user can browse these versions and can understand how data has changed. -- J. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
