BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-21-2006, 07:37 AM   #1
osasuna
New Member
 
Join Date: Jul 2006
Model: 8700v
Posts: 2
Default RecordStoreFullException

Please Login to Remove!

Hi, I'm new here, so I hope this is the right section for this topic. I am developing a java application which has to store some files in a Record Store. Everything works fine until I try to write something in this Record Store. I get RecordStoreFullException. The file which I try to write is 75KB and RecordStore.getSizeAvailable() gives me only 65200bytes. When I go to Options>>Status I see that my phone has 45 000 000 bytes (45MB) free. What's happening? How to solve this? Here are the functions which I use. The function "writeToStore" throws the exception!

Code:
RecordStore rs = null;
       
    public void openStore() {
        try {
            rs = RecordStore.openRecordStore("MileStore", true);
        }
        catch(Exception error) {
            Dialog.alert("Open store: " + error.toString());
        }
    }
        
    public void closeStore() {
        try {
            rs.closeRecordStore();
        }
        catch(Exception error) {
            Dialog.alert("Close Store: " + error.toString());
        }
    }
        
    public int writeToStore(byte[] buf) {
        int ret = -1;
        try {
            ret = rs.addRecord(buf, 0, buf.length);
            lfldc.erase();
            clear_list();
            populate_list();
        }
        catch(Exception error) {
            Dialog.alert("Write to store: " + error.toString());
        }
        return ret;
    }
    
    public void populate_list() {
        try {
            RecordEnumeration re = rs.enumerateRecords(null,null,false);
            int i = 0;
            while(re.hasNextElement()) {
                lfld.insert(i);
                lfldc.insert("Song 1", i);
                i++;
            }
        }
        catch(Exception error) {
            Dialog.alert("Populate List: " + error.toString());
        }
    }
    
    public ByteArrayInputStream getItem(int ind) {
        ByteArrayInputStream ret = null;
        try {
            RecordEnumeration re = rs.enumerateRecords(null,null,false);
            ret = new ByteArrayInputStream(rs.getRecord(ind));
        }
        catch(Exception error) {
            Dialog.alert("GetItem: " + error.toString());
        }
        return ret;
    }
Offline  
Old 07-21-2006, 08:51 AM   #2
eradis
Talking BlackBerry Encyclopedia
 
Join Date: Sep 2004
Model: 8700r
Carrier: Rogers
Posts: 221
Default

From the BlackBerry Application Developer Guide Volume 2:

Quote:
A record store can be a maximum of 64 KB.
The solution is to use multiple record stores or use BlackBerry Persistence Storage.
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


2 conductor 30 awg solid 540' picture

2 conductor 30 awg solid 540'

$50.00



104050 50' 10/4 SOOW Wire Cord Cable Portable Power 10 Gauge 4 Conductor picture

104050 50' 10/4 SOOW Wire Cord Cable Portable Power 10 Gauge 4 Conductor

$147.18



24025 25' 2/4 Wire Cord SOOW , Rubber Coated, 2 Gauge, 4 Conductor, 600V  picture

24025 25' 2/4 Wire Cord SOOW , Rubber Coated, 2 Gauge, 4 Conductor, 600V

$337.50



Starter Battery Cable Copper 6 AWG to 4/0 Gauge - Black Red - 25 or 100 FT - USA picture

Starter Battery Cable Copper 6 AWG to 4/0 Gauge - Black Red - 25 or 100 FT - USA

$283.44



Velvac 050019 12 Awg 7 Conductor Stranded Trailer Cable 100 Ft. Bk picture

Velvac 050019 12 Awg 7 Conductor Stranded Trailer Cable 100 Ft. Bk

$370.99



84025 25' 8/4 SOOW Wire Cord Cable Portable Power 8 Gauge 4 Conductor picture

84025 25' 8/4 SOOW Wire Cord Cable Portable Power 8 Gauge 4 Conductor

$98.60







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