Forum BigDB Error when trying to loadRange from server, Every time.

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

Error when trying to loadRange from server, Every time.

Postby vinceas3 » August 19th, 2011, 6:54 pm

This was happening prior to the latest 2.2.5 patch, which I just patched today hoping by chance that it may have fixed itself.

I have spent hours trying to loadRange from the server, but receive constant errors. I followed the examples verbatim (literatim, codeatim? :D), over and over again, and even tried my own, but still no success. I can loadSingle without any issues, but loadRange, having an issue every single time. I also enabled all rights in the admin panel when creating the table, just for testing purposes.

I will start with the example playerIO has for doing a simple loadRange. I have the proper index and properties in BigDB, and am trying to use this code per the playerIO serverside example:
Code: Select all
//Load all users from Paris that are 30 years old, and were created in April
PlayerIO.BigDB.LoadRange("Users", "ByLocationAgeCreated",
   new object[]{"Paris", 30}, new DateTime(2011, 8, 1),
   new DateTime(2011, 8, 29), 10,
   delegate(DatabaseObject[] result) { Console.WriteLine(result); });


Error: Error: Webservice returned unhandled error: InvalidIndexValue
The start index value of property created is smaller than the stop value


So then I reverse the order, not like that should matter, since the start value should be smaller, obviously. This time the server writes in the Console the following:
"PlayerIO.ServerCore.PlayerIOClient.DatabaseObjectImpl[]"

So the example doesn't work as it should. Prior to trying this, I set up my own very simple table, index and properties, trying to loadRange nearly the same way. First I created an object from the server, and filled in my properties:
Code: Select all
var date = DateTime.Now.Date;
DatabaseObject obj = new DatabaseObject();
obj.Set("datecreated", date);
obj.Set("username", player.ConnectUserId);
obj.Set("notunique", "vinceAS3");
PlayerIO.BigDB.CreateObject("UserTest", null, obj, null);


I repeat this process one time, so I have a different user, two users in all with their own properties filled in.

Filled it in nicely on BigDB as you can see from this screenshot. I didn't include the other user, just to keep it simple. Also, I am using DateTime:
Image

So now, I am going to try to loadRange it from the server using this code:
Code: Select all
PlayerIO.BigDB.LoadRange("UserTest", "UserInfo", new object[] { "vinceAS3" }, new DateTime(2011, 08, 15), new DateTime(2011, 08, 29), 10, delegate(DatabaseObject[] result) { Console.WriteLine(result); });

Error: Error: Webservice returned unhandled error: InvalidIndexValue
The index 'UserInfo' value no. 1 (index 0) must be of type: DateTime


So it wants me to make it Date? No problem. I go back into BigDB and change the property "datecreated" to type "Date" rather than "DateTime" as you can see in this screenshot:
Image

I save, and wait until the index is finished building.

I then use the same code, and try to loadRange again:
Error: Error: Webservice returned unhandled error: InvalidIndexValue
The index 'UserInfo' value no. 1 (index 0) must be of type: Date


So, it doesn't care if I have it set properly as Date or DateTime. If I have it set as Date, it tells me that it must be type DateTime. If I set the type as DateTime, it tells me that it must be of type Date. :lol:

What is the issue? BigDB having issues or is this user error?

Thanks.
vinceas3
 
Posts: 77
Joined: January 16th, 2011, 11:25 pm

Re: Error when trying to loadRange from server, Every time.

Postby vinceas3 » August 28th, 2011, 2:24 am

Just bumping once. I know you mods are busy :twisted:
vinceas3
 
Posts: 77
Joined: January 16th, 2011, 11:25 pm

Re: Error when trying to loadRange from server, Every time.

Postby Henrik » August 29th, 2011, 7:35 pm

Saw it, I'll try to look into it as soon as I can.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Error when trying to loadRange from server, Every time.

Postby vinceas3 » August 29th, 2011, 8:03 pm

Thanks much!
vinceas3
 
Posts: 77
Joined: January 16th, 2011, 11:25 pm

Re: Error when trying to loadRange from server, Every time.

Postby Henrik » September 28th, 2011, 10:01 pm

Hey, sorry for the late reply, and I really should have caught this the first time I saw this thread, but your code is wrong, and you get the correct error message. :-)

If your index is on [datecreated, username, notunique], then your loadrange queries must follow the same order. You can either get a range over datecreated, ignoring username and notunique, or you can get a range of username for a specific datecreated, ignoring notunique, or you can get a range of notunique for a specific datecreated and username. You can do these queries:

Code: Select all
PlayerIO.BigDB.LoadRange("UserTest", "UserInfo", null, new DateTime(2011, 08, 15), new DateTime(2011, 08, 29), 10, delegate(DatabaseObject[] result) { //... });

PlayerIO.BigDB.LoadRange("UserTest", "UserInfo", new object[]{ new DateTime(2011,8,19) }, "a-user", "z-user", 10, delegate(DatabaseObject[] result) { //... });

PlayerIO.BigDB.LoadRange("UserTest", "UserInfo", new object[]{ new DateTime(2011,8,19), "simplett3" }, "a-notunique", "z-notunique", 10, delegate(DatabaseObject[] result) { //... });

But if you want all objects with a specific value for notunique, in a range of dates, then you need to reorder the properties of your index so it's on [notunique, datecreated, username]. If your index looks like that, then you can make your original query.

However, I realize that the error message is really bad, since it's not clear exactly what's wrong with which parameter to LoadRange(). In the next release the error message will be slightly better though.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Error when trying to loadRange from server, Every time.

Postby vinceas3 » November 13th, 2011, 2:10 am

Cool thanks, going to be checking this over.
vinceas3
 
Posts: 77
Joined: January 16th, 2011, 11:25 pm


Return to BigDB