BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-14-2009, 01:13 PM   #1 (permalink)
New Member
 
Join Date: Aug 2009
Model: 9000
PIN: N/A
Carrier: Telcel
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Reading a recordstore produces trash records...

Please Login to Remove!

Hi everybody, I'm facing a very strange issue with the recordstore, and wanted to check if anybody else had found it as well.

The code adds a bunch of records to various recordstores, one after the other, and everything goes well most of the time, however, upon having added more than 1,000 records total, and more than 100 on the current Recordstore, a "trash" record is read by the RecordData filter.

...Previous records added here...

Code:
                        System.err.println(sItemID + "--" + sName);
                        int recdebgid = oPst.addOrReplaceItem(Integer.parseInt(sItemID), sName);
                        
                        try{
                        System.err.println(String.valueOf(recdebgid) + "++" + String.valueOf(oPst.theRecordStore.getVersion()));}
                        catch (Exception oEx) {System.err.println(oEx.toString());} 
                        
                        //DEBUG
                        if (itemName.equalsIgnoreCase("class") & sName.equalsIgnoreCase("rkvone"))
                        {
                            ItemList aDebugList = oPst.getItemsList();    
                            aDebugList = null;       

                        }
In the above code, if we examine the values in recdebgid and theRecordStore.getVersion(), we'll see that everything is correct, with records being inserted well, and the version being incremented as expected; this is also true, upon reaching record 120 in the current recordstore; howver, if at this point we traverse the complete record list on the current recordstore, task done by the function getItemsList(), we get a non-existent record returned.

Then, if our original list looks like this:

ItemID 81 Value "rkv1"
ItemId 82 Value "rkvone"
ItemID 83 Value "rkvone:rkv1"

Upon reading all records we get:

ItemID 81 Value "rkv1"
ItemID 1298998373 Value "u000 u000 u000 R"
ItemId 82 Value "rkvone"

Now, if this were inserted by my code, the recordstore version and nextrecordID would reveal it, but they don't. Hence I belive this is a bug in the recordfilter function, which somehow is including that non-existent record into the result set.

So, have you seen this happen as well?

Thanks,
Sergio Flores
IHG Studios
Offline  
Old 08-17-2009, 07:41 PM   #2 (permalink)
New Member
 
Join Date: Aug 2009
Model: 9000
PIN: N/A
Carrier: Telcel
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey as it turns out, it was a very obscure bug in my code. Thanks for reading though!

SF
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.