BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 04-30-2009, 01:04 PM   #1 (permalink)
Thumbs Must Hurt
Join Date: May 2008
Model: 8700
Carrier: Telcel
Posts: 69
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Weird problem deleting RMS

Please Login to Remove!

I'm running a pretty weird problem on my application.

I store data i download from the internet on several RMS, once they are used and there no need for those, the RMS has to be erased, but I have this problem. The RMS will be deleting "sometimes" and not always as is supposed to be.

I'm developing this application specially for balckberrys, hence i'm using the blackberry API, the only j2me thing i'm using is the RMS as I have been working with this application for over a year and i'm already waaaay to used to the RMS.

Well, the problem is, sometimes, when trying to delete the RMS, they will be deleted withouth a problem, but other times, they won't be and a RecordStoreException is thrown were the error message is just the name of the RMS i want to delete.

This is the code of the deleting process

PHP Code:

public void wipeOut(String rutaString itinerario)
salirSistema(); // This makes sure the RMS are closed
nombre RecordStore.listRecordStores();
        * Nomenclatura de la tablas
        * rutaDBRxIyTz
        * sistemaDBRxIy
        * EnviadosRxIy
        * RevisadosRxIy
        * R -> Ruta
        * I -> Itinerario
        * T -> Tabla
        * x, y, z -> Son nĂºmeros enteros que pueden ser del 0 hasta el infinito
for (int i 0nombre.lengthi++)
                if (
contenido(nombrexxx91;ixxx93;, "rutaDBR" ruta "I" itinerario "T"))
                else if (
nombrexxx91;ixxx93;.equals("EnviadosR" ruta "I" itinerario))
                else if (
nombrexxx91;ixxx93;.equals("RevisadosR" ruta "I" itinerario))
                else if (
nombrexxx91;ixxx93;.equals("sistemaDBR" ruta "I" itinerario))
RecordStoreNotFoundException e)
Debug("No se encontro la tabla " nombrexxx91;ixxx93;);
RecordStoreException e)
Debug("Se suscito un error: " e.getMessage());
Exception e)           
Debug("Se suscito un error: " e.getMessage());               
// message(mensaje, 2500, formaLogin);       

I have 4 types of RMS.
1.- rutaDBRxIyTz, were i store all my data, but given that there can be a lot of data to be downloaded and a RecordStoreFullException might be thrown, I store it in several subsecuents RMS. Hence the Tz, where T stands for Table and z the secuencial number of the RMS so somtimes there can be a lof ot tables like this:
2.- sistemaDBRxIy, were is store information regarding the data is being worked liked how many registers were downloaded, how many haven already revised and how many sended back and stuff like that
3.- RevisadosRxIy, were i check which indexes on the rutaDB RMs have been already reviewed
4.- EnviadosRxIy, were i check which indexes on the rutaDB RMs have been sended back to the server DB

Becuase i want to make sure i'm not commiting a mistake when deleting the RMs, i store all the current created RMS on a String array (nombre) and go through it comparing the names to the ones i want to delete. In the case of the rutaDBRxIyTz RMS's, i don't know how many RMS's were created to store all the data, so for that I created a function named "contenido" that works as the String function subString() so I look in the index "i" of "nombre" for the subString "rutaDBRxIyT" and when its a match it means it one of the tables created. Once i found a match i delete that RMS. But sometimes the RecordStoreException is thrown and the error message is the name of the RMS.

When creating the RMS, i only set the name and the boolean value (openRecordStore(String recordStoreName, boolean createIfNecessary) ).

Any idea why this might be happening. Its driving me crazy as there's no logic for it

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