| I did have an issue in my test, namely not making sure I wait for all the watches to fire. I added a check for that now: https://gist.github.com/1961660, but still the test fails. |
test-get-data.tar.gz
Description: GNU Zip compressed data
Amir
On Mar 2, 2012, at 1:58 PM, Amirhossein Kiani wrote: Hmm... I tried testing the idea that if I call the getData() on updated node in the watcher's process() method I'll get the updated data. I created a watcher class that keeps track of the values it's receiving and in my test I sequentially set 10000 values on the node. I do see that some times I'm getting the OLD VALUE.
I wonder if the way I'm setting the data or getting it is incorrect.
Here are the main files in my test:
You can run my test by running "mvn test" in the maven project attached. <test-get-data.tar.gz>
Many thanks for your help! Amir
On Mar 2, 2012, at 11:27 AM, Patrick Hunt wrote: On Fri, Mar 2, 2012 at 11:23 AM, Amirhossein Kiani < [email protected]> wrote: Many thanks Patrick for pointing me to the new documentation. I just found the other one from Google somehow.
No problem. So what I think is happening is actually impossible: to do getData() on a node and see the OLD data. in other words, I do not need to loop on a getData() to get the actual new data after being notified about the data change.
The reason that I'm saying that is that's the behavior I'm seeing in my code, but it might be just a bug on my side...
Sounds like. Keep in mind that there might be multiple changes btw the time the notification fires and when your getData runs on the server. Perhaps someone's changing it back? :-) Patrick
|