BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-30-2009, 01:04 PM   #1
CJLopez
Thumbs Must Hurt
 
Join Date: May 2008
Model: 8700
PIN: N/A
Carrier: Telcel
Posts: 69
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++)
        {
            try
            {
                
Debug(nombrexxx91;ixxx93;);
                if (
contenido(nombrexxx91;ixxx93;, "rutaDBR" ruta "I" itinerario "T"))
                    
RecordStore.deleteRecordStore(nombrexxx91;ixxx93;);
                else if (
nombrexxx91;ixxx93;.equals("EnviadosR" ruta "I" itinerario))
                    
RecordStore.deleteRecordStore(nombrexxx91;ixxx93;);
                else if (
nombrexxx91;ixxx93;.equals("RevisadosR" ruta "I" itinerario))
                    
RecordStore.deleteRecordStore(nombrexxx91;ixxx93;);
                else if (
nombrexxx91;ixxx93;.equals("sistemaDBR" ruta "I" itinerario))
                    
RecordStore.deleteRecordStore(nombrexxx91;ixxx93;);
            }
            catch(
RecordStoreNotFoundException e)
            {
                
Debug("No se encontro la tabla " nombrexxx91;ixxx93;);
            }
            catch(
RecordStoreException e)
            {
                
Debug("Se suscito un error: " e.getMessage());
            }
            catch(
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:
rutaDBRxIyT0
rutaDBRxIyT1
rutaDBRxIyT2
.
.
.
rutaDBRxIyTn
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
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


6.3V 10V 16V 25V 35V 50V 100V 400V SMD Aluminum Electrolytic Capacitor 1-1000 UF picture

6.3V 10V 16V 25V 35V 50V 100V 400V SMD Aluminum Electrolytic Capacitor 1-1000 UF

$155.59



CBB61 250V  Capacitor 2 wires 1/2/3/3.5/4/5/6/7/8/9/10/12/15/18/20/24/25/30 UF picture

CBB61 250V Capacitor 2 wires 1/2/3/3.5/4/5/6/7/8/9/10/12/15/18/20/24/25/30 UF

$129.95



45/5 MFD ±5% Dual Run Capacitor 370 450 VAC CBB65 AC Motor HVAC 45+5 uF Fan 10pk picture

45/5 MFD ±5% Dual Run Capacitor 370 450 VAC CBB65 AC Motor HVAC 45+5 uF Fan 10pk

$85.99



5pc Radial Electrolytic Capacitor 250V 100V 50V 25V 16V 0.22uF-4700uF 10000uF picture

5pc Radial Electrolytic Capacitor 250V 100V 50V 25V 16V 0.22uF-4700uF 10000uF

$27.99



10 MFD AC Capacitor, 10uF ±5% 370VAC/440 Volt Oval Run Start Capacitor picture

10 MFD AC Capacitor, 10uF ±5% 370VAC/440 Volt Oval Run Start Capacitor

$10.97



500pc Radial Electrolytic Capacitor Assortment Kit 24 Value 0.1uF-1000uF 10V-50V picture

500pc Radial Electrolytic Capacitor Assortment Kit 24 Value 0.1uF-1000uF 10V-50V

$13.04







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