Forum BigDB Could not grab locks for objects

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

Could not grab locks for objects

Postby BigBonce » March 13th, 2011, 3:15 pm

I'm occasionally having issues with saving/updating objects, getting the error message "Could not grab locks for objects: there was too much access to the given objects in the allotted time."

There are no concurrent operations on the table, and it seems like some objects in the table occasionally lock up. When they locked up all repeated attempts to save will fail. Creating a new table everything will work again until objects starts locking up again.

The game is under development, so I'm the only user, and this is the code I'm using:
Code: Select all
_client.bigDB.loadOrCreate("scores", team.code, function (o:DatabaseObject):void
                                                {
                                                   if (o.points != null)
                                                   {
                                                      o.points += team.points;
                                                   } else
                                                   {
                                                      o.points = team.points;
                                                   }
                                                   if (o.games != null)
                                                   {
                                                      o.games += 1;
                                                   } else
                                                   {
                                                      o.games = 1;
                                                   }
                                                   o.save(false, false, onSaveTeamScoreComplete);
                                                },
                                                onSaveScoresError);

Any ideas what I might be doing wrong would be greatly appreciated.
BigBonce
 
Posts: 5
Joined: February 7th, 2011, 8:15 pm

Re: Could not grab locks for objects

Postby BigBonce » March 14th, 2011, 10:16 am

Now the error is not occasional as I experienced yesterday. Creating a new table will not help, and any attempt to save a DatabaseObject will fail.
I tried using bigDB.load as well as bigDB.loadOrCreate, and have tried to simply add a value like this:
Code: Select all
_client.bigDB.loadOrCreate("scores", team.code, function (o:DatabaseObject):void
                                                {
                                                   o.games = 1;
                                                   o.save();
                                                });

This happens even if I ensure that same table is not accessed anywhere else in the code and I use a fresh empty table.
Odd thing is that the code did work the other day, and then I started getting the error occasionally, and now it always happens.

I cannot seem to find anything I can do differently to get around the issue, and as far as I can see there is nothing in my code that is different from examples in your documentation.
BigBonce
 
Posts: 5
Joined: February 7th, 2011, 8:15 pm

Re: Could not grab locks for objects

Postby BigBonce » March 14th, 2011, 12:17 pm

Stripped things down to the basics to ensure that I'm not missing something, created a new table "test", with no indexes and full rights.
The code I use to test:
Code: Select all
package 
{
   import flash.display.Sprite;
   import playerio.Client;
   import playerio.DatabaseObject;
   import playerio.PlayerIO;
   import playerio.PlayerIOError;
   
   public class PlayerIOTest extends Sprite
   {
      private var _gameid:String = "xxxxxxxxxxxxxxxxx";
      private var _client:Client;
      public function PlayerIOTest()
      {
         PlayerIO.connect(stage, _gameid, 'public', 'fbxxxxxxxxxxxx', '', onPlayerIOConnect, onPlayerIOError);
      }
      
      private function updateScore():void
      {
         _client.bigDB.loadOrCreate("test", "SE", function(o:DatabaseObject):void
         {
            o.points = 1;
            o.save();
         });   
      }
      
      private function onPlayerIOConnect(c:Client):void
      {
         _client = c;
         updateScore();
      }      
      
      private function onPlayerIOError(e:PlayerIOError):void
      {
         trace("PlayerIOService.as.onPlayerIOError: e.message = " + e.message);
      }
      
   }

}

Getting the same error: "Could not grab locks for objects: there was too much access to the given objects in the allotted time."
BigBonce
 
Posts: 5
Joined: February 7th, 2011, 8:15 pm

Re: Could not grab locks for objects

Postby Oliver » March 14th, 2011, 5:55 pm

Hi,

I tried reproducing the bug as described and i couldn't. This leads me to believe that it was related to to an issue we had today with our distributed caching layer. We've reset some servers so that the issue is no longer there and we're investigating the root cause of the issue, so that we can prevent if from happening again.

Terribly sorry for the inconvenience.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Could not grab locks for objects

Postby BigBonce » March 14th, 2011, 6:03 pm

Thanks, I set up a new game and then it worked. Don't know if the old game got corrupted somehow if it was just coincidence that I set it up at the same time you resolved the issue in your end.
BigBonce
 
Posts: 5
Joined: February 7th, 2011, 8:15 pm

Re: Could not grab locks for objects

Postby BigBonce » March 16th, 2011, 9:47 pm

Suddenly the issue reappeared.
Also, despite having an error callback, instead of passing and error an exception is thrown.

I'm just finishing up the game now, but since it seems like the BigDB database can break down at any time I guess I have to use another solution for the back-end.
Unless you can point out something I can do to avoid the issue or can give me guarantees that it wont keep happening, is there any chance to have subscription I made today refunded?
BigBonce
 
Posts: 5
Joined: February 7th, 2011, 8:15 pm

Re: Could not grab locks for objects

Postby Oliver » March 17th, 2011, 7:55 pm

Hi,

First of all, we offer a 30-day money back guarantee, and of course we'll give you a full refund. I'll contact you privately over e-mail to work out the details.

Secondly, about your problem. We haven't heard other reports of issues like that since, nor seen any red lights from the distributed caching layer like the other day, so i'm completely baffled by your report.

I tried reproducing it again just now, and it works for me with no issue. Obviously, if we have a bug in our systems we want to find and eradicate it, so i'm wondering if you'd do me a favor and send me the code for your game project, so we can have a deeper look? I can promise you we won't share it etc, and we can even sign a NDA or simliar if you want to... we just want to use it to locate and eradicate the issue.

I'll also send you my messenger&skype details in the above mentioned e-mail, and you can grab me directly when you see it happen.

Regarding the last thing you mentioned, about it throwing an exception instead of calling your errorCallback, i think that's a code error on your end. If you look at the code snippet you posted:

Code: Select all
_client.bigDB.loadOrCreate("scores", team.code, function (o:DatabaseObject):void
                                                {
                                                   ...
                                                   o.save(false, false, onSaveTeamScoreComplete);
                                                },
                                                onSaveScoresError);


You'll see that you're actually passing your errorHandler ('onSaveScoresError') into the loadOrCreate() method. It will only be called if there are errors in that call. If you want to catch errors when saving the object, you have to use this:

Code: Select all
o.save(false, false, onSaveTeamScoreComplete, onSaveTeamScoreFail);


Again, sorry for it not working for you.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Could not grab locks for objects

Postby wbsaputra » March 27th, 2011, 9:15 am

just reporting: got this error when creating object property in admin panel
Could not grab locks for objects: there was too much access to the given objects in the alloted time
maybe this has the same issue for today cache layer error
wbsaputra
Paid Member
 
Posts: 150
Joined: June 29th, 2010, 4:38 pm


Return to BigDB



cron