Forum ‹ BigDB ‹ Help with saving online status with bigDB
12 posts
• Page 1 of 1
Help with saving online status with bigDB
I use online status with BigDB object and save at userleft method.
Any advice how to make sure bigdb save running while userleft and room close?
i keep getting this error
Error clearing online status PlayerIO.GameLibrary.PlayerIOError: The database object XXXX could not be saved using optimistic locks as it's out of date.
yeap i use optimistick lock, is this cause a problem?
Any idea?
Any advice how to make sure bigdb save running while userleft and room close?
i keep getting this error
Error clearing online status PlayerIO.GameLibrary.PlayerIOError: The database object XXXX could not be saved using optimistic locks as it's out of date.
yeap i use optimistick lock, is this cause a problem?
Any idea?
- wbsaputra
- Paid Member
- Posts: 116
- Joined: June 29th, 2010, 4:38 pm
Re: Help with saving online status with bigDB
Optimistic locks will fail if you have a lot of writes going into the same object at the same time.
Are you trying to save online status for all users in a single database object?
- Oliver
Are you trying to save online status for all users in a single database object?
- Oliver
-

Oliver - .IO
- Posts: 1136
- Joined: January 12th, 2010, 8:29 am
Re: Help with saving online status with bigDB
No i use player object for each user to save their online status.
i've remove optimistic locking now, seems working fine, but sometimes there are limit to save player object at sametime like this "Could not grab object because to many save bla2...".
Is there anyway to resolve this?
i've remove optimistic locking now, seems working fine, but sometimes there are limit to save player object at sametime like this "Could not grab object because to many save bla2...".
Is there anyway to resolve this?
- wbsaputra
- Paid Member
- Posts: 116
- Joined: June 29th, 2010, 4:38 pm
Re: Help with saving online status with bigDB
Stop doing so many saves at the same time. There's a limit to concurrent writes to the same object in bigdb.
- Oliver
- Oliver
-

Oliver - .IO
- Posts: 1136
- Joined: January 12th, 2010, 8:29 am
Re: Help with saving online status with bigDB
Oliver wrote:Stop doing so many saves at the same time. There's a limit to concurrent writes to the same object in bigdb.
- Oliver
Okay, but how about player leaving room at the same time? I should save their online status to each player object right?
Or how if more than 5 player disconnect at the same time or suddenly room closed, their online status is stuck if cause there is a limit to save object.
- wbsaputra
- Paid Member
- Posts: 116
- Joined: June 29th, 2010, 4:38 pm
Re: Help with saving online status with bigDB
It's is a limit per object.
You can have many saves going on concurrently to different objects if you want.
You can even have concurrent saves going on to the same object, but it has to be less than the limit.
The only reason it would fail to call PlayerObject.Save() in UserLeft() is if you already had too many saves going on at the time.
- Oliver
You can have many saves going on concurrently to different objects if you want.
You can even have concurrent saves going on to the same object, but it has to be less than the limit.
The only reason it would fail to call PlayerObject.Save() in UserLeft() is if you already had too many saves going on at the time.
- Oliver
-

Oliver - .IO
- Posts: 1136
- Joined: January 12th, 2010, 8:29 am
Re: Help with saving online status with bigDB
I use this method
result.Set("Online.RoomId", myroom.RKey);
result.Set("Online.RoomRegion", myroom.Region);
result.Set("Online.RoomType", myroom.Type);
result.Set("Online.RoomCode", myroom.Code);
result.Set("Online.Firstname", ply.firstname);
result.Set("Online.Init", true);
You mean "Online" is one object?
result.Set("Online.RoomId", myroom.RKey);
result.Set("Online.RoomRegion", myroom.Region);
result.Set("Online.RoomType", myroom.Type);
result.Set("Online.RoomCode", myroom.Code);
result.Set("Online.Firstname", ply.firstname);
result.Set("Online.Init", true);
You mean "Online" is one object?
- wbsaputra
- Paid Member
- Posts: 116
- Joined: June 29th, 2010, 4:38 pm
Re: Help with saving online status with bigDB
no, result is.
-

Oliver - .IO
- Posts: 1136
- Joined: January 12th, 2010, 8:29 am
Re: Help with saving online status with bigDB
how many is limit save per one object?
- wbsaputra
- Paid Member
- Posts: 116
- Joined: June 29th, 2010, 4:38 pm
Re: Help with saving online status with bigDB
i think it's 5
-

Oliver - .IO
- Posts: 1136
- Joined: January 12th, 2010, 8:29 am
Re: Help with saving online status with bigDB
ok, i try change mo code,
btw can i get server time at client side before user joining room with as3?
I need calculate time different between current server time and last time user login to give user daily bonus etc.
btw can i get server time at client side before user joining room with as3?
I need calculate time different between current server time and last time user login to give user daily bonus etc.
- wbsaputra
- Paid Member
- Posts: 116
- Joined: June 29th, 2010, 4:38 pm
Re: Help with saving online status with bigDB
You can't get the time on a server without connecting to a server... 
-

Oliver - .IO
- Posts: 1136
- Joined: January 12th, 2010, 8:29 am
12 posts
• Page 1 of 1