Forum BigDB Proper error handling?

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

Proper error handling?

Postby robscherer123 » October 7th, 2013, 3:46 pm

I have a question on what is considered proper error handling? This is mostly to do with BigDB requests.

First question is: Why do operations to save/load fail? It is the internet, so I imagine things like this just happen, so maybe there is no real answer?

Second question: This may slightly depend on the answer to my first question, but is it proper handling to re-try the function if the save/load failed? For example if I try to save a players data, should I just immediately re-try to save again and again if it has failed?
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm

Re: Proper error handling?

Postby Benjaminsen » October 8th, 2013, 7:19 pm

It should be perfectly ok to retry. Are you trying to save with useOptimisticLocks set to true?
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Proper error handling?

Postby robscherer123 » October 8th, 2013, 9:05 pm

Ok cool, thanks! I just wanted to make sure it wasn't redundant and doomed to fail if tried immediately after. I do not believe I have useOptimisticLocks set to true, unless they are set to true by default? I just call dbObject.save() without usually passing any parameters, except maybe a delegate function sometimes.

It's not a major problem, just something that happens every so often that would be nice to fix.
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm

Re: Proper error handling?

Postby Benjaminsen » October 10th, 2013, 6:31 pm

Well that sounds very bad then, can you provide a reproducible example we can look at?
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Proper error handling?

Postby robscherer123 » October 15th, 2013, 2:26 pm

Nah, I definitely wouldn't be able to replicate, it doesn't happen near often enough. Like I said though, it's not a major problem, I was just curious how to go about error handling with it. I just made it so that it will attempt to save up to a maximum of 4 times if the previous saves fail. Hopefully that will greatly reduce the chance of any failed saves that will occur. :)
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm


Return to BigDB