kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

Data Change Notifications sometimes are missing data #214

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a difficult one to reproduce because it is a transient problem.  I have 
an object of class A 
with an array of references to objects of class B, each of which has a 
reference to an object of 
class C.  Classes A and B are stored in the default data source local to 
Persevere.  Class C is 
stored in a remote MySql database.  All the references in this scenario are set 
to {lazy: false}, so 
that I get all the information when I retrieve an object of class A.

On the client side, I am accessing objects through Dojo's Persevere Store with 
ClientFilter's local 
cacheing and RestChannels enabled.

First, I retrieve the object of class A, setting up a subscription.
I then modify the array of references to B and issue a global save.  This 
modification may consist 
of creating or deleting an object of class B and then adding or removing the 
element from the 
array.  The global save, therefore, causes two requests to be issued to 
Persevere: a create or 
delete of a B and a PUT for the object of class A.

The PUT causes a data change notification to come back over RestChannels.

The problem is that sometimes, the data that comes back in the notification is 
missing data.  
This does not happen every time.  I usually follow the above process a couple 
of times in 
succession, and it generally happens within 3 or 4 attempts.

Specifically, the data that is missing is all of the contents of the object of 
class C, for at least one 
object of class B.  All of the other properties of B are present and correct, 
but the object of class 
C comes back with an id property and nothing else.  I have verified this using 
Wireshark to 
examine the contents of the HTTP messaging.

This is a problem because Dojo, when it sees this notification, stores this 
version of the object in 
its local cache, and this can cause problems with any code that accesses the 
object immediately 
after the notification occurs.

A fresh GET of the object from the server returns the correct version of the 
objects with no 
missing data.  Also, the version of the object returned from the save action is 
correct.  Only the 
notification message appears to be broken.  

This problem occurred using both Firefox on Mac OS and Windows, and on Safari 
on a Mac.  No 
other configurations were tested. 

This problem may be related to the fact that objects of class C are stored in 
an external 
database.  I have since converted my code to use an object that is stored in 
Persevere's local data 
store instead, and I have not seen the problem in this condition.

Original issue reported on code.google.com by dsta...@gmail.com on 10 Jul 2009 at 5:55