Forum BigDB need help with save operations error

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

need help with save operations error

Postby wbsaputra » February 11th, 2011, 1:02 am

Any tips to handle this type error? in game i'm only save to playerobjects when user leave rooms.
How many save operations allow in server? cause my game will really have lots user enter and leave rooms in future.
This will become problem, any itips will apreciated. :|
Cannot save changes to database object '132' in table 'PlayerObjects', because there are too many (5) save operations in progress already on the object. Please consider refactoring your code to avoid calling .Save() this often.
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm

Re: need help with save operations error

Postby Benjaminsen » February 14th, 2011, 9:12 am

You can have up to five save operations on each DatabaseObject. Can I see the code that results in the error you describe, it sounds like you are calling .Save in a loop or some such.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: need help with save operations error

Postby azuanagames » February 14th, 2011, 6:19 pm

This error is showing up occasionally in my log as well. I am doing the same exact thing .save() upon user leave or enter. (Enter to save their last log-in time.) I also .save() at the end of each game. I really don't see how there can be 5 pending saves.

I'm guessing there is a time out that's occurring on a save() and it's never decrementing the count or re-trying the save?

------------------------------------------------------------------------------------------------------------------------------------------
Cannot save changes to database object 'fbXXXX' in table 'PlayerObjects', because there are too many (5) save operations in progress already on the object. Please consider refactoring your code to avoid calling .Save() this often.

First seen 13 hours ago, latest 13 hours ago. (delete 3 errors)

at AzuanaBingo2.Player.save()
at AzuanaBingo2.GameCode.b__a()
-------------------------------------------------------------------------------------------------------------------------------------------

Also this isn't even saying the code is running for too long anymore either:

-------------------------------------------------------------------------------------------------------------------------------------------
Thread was being aborted.

First seen 8 days ago, latest 4 hours ago. (delete 66 errors)

at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at AzuanaBingo2.GameCode.startCaller()
-------------------------------------------------------------------------------------------------------------------------------------------

The startCaller() call does nothing special, it just sets the game state and starts a timer. It may also do a Broadcast.
azuanagames
 
Posts: 157
Joined: April 29th, 2010, 10:59 pm

Re: need help with save operations error

Postby wbsaputra » March 24th, 2011, 9:50 pm

lets says in one room have maximum 45 users right,
in my game only 7 player max can play can join table, yes, is like poker game, the rest player in the room is guest or just watching the game play or waiting empty sit to join.
when the game finish i had to save this 7 player score into player objects table, that's looping foreach player is needed right?
meanwhile in the game other guest player and new player are freely leaving and enter the room. I had to set their online status also using player object table.
How can i handle this in code while i have only 5 save operations?
is this 5 save operation is just for 1 table object? how if i save with 2 table object? am i still get this kind of error?
Need advice because im still getting save operation error.
Last edited by wbsaputra on March 24th, 2011, 10:09 pm, edited 1 time in total.
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm

Re: need help with save operations error

Postby wbsaputra » March 24th, 2011, 10:04 pm

btw i also need to know how preload player object act, just in case like this example:
player 1 had 100 life point in player object table.
player 1 enter the room no 1, this player also enter the room no2 (i can't find yet a solution to prevent this)
on each room i set preload player object so this player had starting 100 life point on each room.
when the game is finish, each room is saving this player life point left

i want to know is playerobject save method always save to real table object or temporary stored on room and apply to player object table only when user leaving room or the room closed?

in this case this player can play with double life point at the same time and at the end of the game this player life point is mixed with life point in the second room right?

any advice? :(
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm


Return to BigDB



cron