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


iPhone 13 12 11 PRO MAX XR XS 8/7/6 Fast Charger USB Data Cable cord 10 feet/3M picture

iPhone 13 12 11 PRO MAX XR XS 8/7/6 Fast Charger USB Data Cable cord 10 feet/3M

$4.99



OEM iPhone 11 PRO X/XR XS MAX 8/7 PLUS Fast Charging USB Cable 10 Feet & 6 Feet  picture

OEM iPhone 11 PRO X/XR XS MAX 8/7 PLUS Fast Charging USB Cable 10 Feet & 6 Feet

$2.99



10 Foot/3M iPhone 12/11 PRO MAX X/10 XR XS 8/7 FAST Charging USB LONG Cable cord picture

10 Foot/3M iPhone 12/11 PRO MAX X/10 XR XS 8/7 FAST Charging USB LONG Cable cord

$4.98



10 Feet/3M For iPhone 13 12 11 PRO MAX MINI  X XR XS 8 7 Fast Charging USB Cable picture

10 Feet/3M For iPhone 13 12 11 PRO MAX MINI X XR XS 8 7 Fast Charging USB Cable

$5.00



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$37.90



OEM Battery for MacBook Pro 17

OEM Battery for MacBook Pro 17" A1309 A1297 Early 2009 Mid 2009 2010 MC226

$36.90







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