Forum BigDB Problem making multiple rapid saves to DatabaseObject

Discussion and help relating to the PlayerIO database solution, BigDB.

Problem making multiple rapid saves to DatabaseObject

Postby cjcenizal » May 31st, 2011, 11:43 pm

In my BigDB, every user owns a Goals object in a table. As they complete various goals and unlock others, the corresponding DatabaseObject is modified with the completed goal and saved. Some of the goals are very simple to complete. For example, sometimes you can just click an "OK" button multiple times and burn through a bunch of goals super fast.

I've noticed that when this happens, some of the save() calls seem to be "skipped". Examining the tutorial DatabaseObject reveals that some goals are saved as incomplete, while later goals save as complete. This is a problem, since the user will see completed goals show up as incomplete.

What's causing this and is there anything I can do to solve this problem? My save call looks like this:

Code: Select all
databaseObject.save( false, false, onComplete, onError );


Additionally, I sometimes will get this error if I save too quickly: "An unexpected error occured inside the Player.IO webservice. Please try again."

Upon reloading the game, I then get the Flash TypeError from my earlier "Deleted data does not stay deleted post": post5631#p5473 .

Thanks, guys.

EDIT: I just encountered a related problem, and figured I should append this post rather than make a new one. I've just tried truncating this Goals table repeatedly, and though BigDB tells me the table's been truncated, opening and viewing the table shows all the data is still there. I was able to solve the problem by deleting the data manually. Other tables truncate just fine, it's only this Goals table which is causing problems.
cjcenizal
Paid Member
 
Posts: 115
Joined: March 29th, 2011, 12:31 am

Re: Problem making multiple rapid saves to DatabaseObject

Postby Benjaminsen » June 1st, 2011, 8:23 am

I am currently looking into this error. Stay tuned.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Problem making multiple rapid saves to DatabaseObject

Postby Benjaminsen » June 2nd, 2011, 11:54 am

Hep, a quick update to say that I have just released an updated Player.IO flash bridge that fixes the issue where BigDB objects can get out of synchronization if an error occurs during saving.

Thus your problem where you are spamming Player.IO with changes should be totally gone now.
Even better, the API is now a lot cleverer combining several saves into single saves if they happen in rapid succession saving you a ton of bandwidth.

To get the update, you have to do... absolutely nothing, it's already live for your game.

/Chris
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Problem making multiple rapid saves to DatabaseObject

Postby cjcenizal » June 2nd, 2011, 4:40 pm

YES!!!!! Great work!!!!
cjcenizal
Paid Member
 
Posts: 115
Joined: March 29th, 2011, 12:31 am


Return to BigDB



cron