Sign In Register

How can we help you today?

Start a new topic

GameSparks Persistor Not Immediate

Hi GameSparks,


The persistor is not making updating the documents immediately. I have written a test code where a document is retreived from the API by ID, a field is modified, and then persisted. Next, the code queries the API for the new field value, but the modified document is not found. However, if the code searches for the document by ID instead, then the modified document is found. It seems like the field value is not immediately persisted for API queries? If not, how can I ensure that persistence is done before I query again?


Thanks,

Nalu


For me sounds reasonable. Querying is expensive operation and probably is always based on indexes which must be rebuild after any data change and this takes time, a lot of time if data set is big. But if getItem works immediately after saving document it's fair enough for me to write rock solid solution.

i'm sorry, but this is a bad implementation, this makes all the query system untrustfull


1 person likes this

Hi Nalu,


The queryItems GDS function is eventually consistent, meaning that if you query immediately after persisting something you may not see the results you expect. getItem on the other hand is immediately consistent; so if you retrieve the item by id rather than by querying, you should get the modified document in the response.


Regards,

Vinnie


Login to post a comment