Persistent storage problem

Hi all

I use a persistent storage to store my data.

Question: Persistent data are automatically get updated while recovery of persistence data and store it in a variable local object and then modify this local variable, observe that the persistent data are also changed without saving my new changes.

I'm storage array of user defined class in persistent for example myclass [];

I used to store vector which has been also get updated so I have changes to my class, I'm storage table because I store the list of objects of 'MyClass '. By changing the vector in [myclass] problem has been solved, but now I'm getting same result once again.

I create a listener in the background that will read persistent data and send only data used to my application in the foreground, but when I do some changes in my local object again once it finds that the data gets reflected in persistent.

Please let me know what I am doing wrong. I created a library of my persistent classes so that the foreground and background the two application could access.

Looks like my storage

Class Myclass implements persistable

{

certain types of data from premitive

MyClass2 [] arrayOfSecondClass;

}

class Myclass2 implements persistable

{

certain types of data from premitive

Myclass3 [] arrayOfThirdClass;

}

class Myclass3 implements {persistable

Some data from premitive

}

//////////////////////////////////////////////////////////////

call persistent to save and retrieve data:

Thank you Peter and James,.

It's corrected now. Your example simple singleton helped to understand the major concept.

Kind regards

Aparna Bloe

Tags: BlackBerry Developers

Similar Questions

  • iPhone storage problems 6

    In the last two days, I get alerts non-stop from my iPhone saying I don't have enough storage space.

    My camera and WhatsApp are blocked

    Even if I deleted a lot of apps, deleted all my photos (including the deleted items) and archived most of my conversations of WhatsApp.

    I synced my iPhone and installed the new version of the software - so everything is clean and up-to-date

    Always - the problem persists and there is storage problems.

    Until two days ago, there was no problem and I got a lot of data on the phone - now I have half of the size of the data and the phone is full and stuck.

    It seems a bug or something because it makes no sense... Two of my friends have the same problem!

    What can I do and how can it be solved?

    Help, please!

    This thread:

    storage of iphone issues 6

    addresses the issue in detail; suggested solutions are doing a restore and remove the Whatsapp application.

  • Register a class in a persistent storage?

    I have a class with many defined configuration variables. These are defined during execution. Is it possible to back up and recover the class in a persistent storage? If so, how?

    The situation you are trying to encode to is easily manipulated with permanent storage.

    If you look at the works of persistent store, you basically store an object in a persistent crack, which is identified by an ID - the ID is along the value.  Anyone who knows the ID can access the object.

    However, to interpret the object, they must have the exact class which was used when the object was stored.  In your case, it's easy as your two 'Applications' will actually use the same class that they are actually just different entry points into the same set of code.

    This requirement for the same class to use, becomes a problem when you have two totally different applications using the same persistent ID.  In this case, both applications have to share a class library that defines the persistent object.

    But back to your situation, what you're trying to work with persistent store.

    To give you more feeling for her, if your application asks the persistent object, it gets a reference to an object in the flash memory.  When your GUI application did the same thing, he will get a reference to the same object.  Then they will certainly share data, and consider it both one and other updates.

    Hope that clears it for you.

  • store integers in a persistent storage

    Hi all - I'm being a key on this one I don't know. The SDK V5. Have a persistent storage object that contains an integer. If its creation as:

    persistentHashtable.put ("GPRSUpdate", New Integer (180)); in a few seconds

    Now have an editsettings (behind a login screen) screen which displays the value and allows it to be updated using an editfield. I am then convert the integer to a string and then add it to the ediitfield as follows:

    If (persistentHashtable.containsKey ("GPRSUpdate")) {}
    Integer gprsInt = (Integer) persistentHashtable.get ("GPRSUpdate");
    testInt int = gprsInt.intValue ();
    String testString = Integer.toString (testInt);
    editGPRSUpdateInterval.setText (testString);
    }

    so, which works very well. The problem is that I can't save a change and then log in to the screen later without the bombing with a classcastexception error application. The problem, I'm sure that resides in the code that performs the backup that is as follows:

    public void saveOptions() {}
           
    String gprsUpdated = editGPRSUpdateInterval.getText ();
    int savegprsInt = Integer.parseInt (gprsUpdated);
            
    persistentHashtable.put ("GPRSUpdate", New Integer (savegprsInt));
        
    persistentObject.commit ();

    }

    Can someone please explain tp starting it what is the problem? I don't know that its confused me again between objects and data types, but if someone could point out where I'm wrong it would be appreciated. See you soon

    Nothing wrong with this code that I can see.

    Can you tell us the line that throws the exception of cast.  What kind of object you actually have (debugger should find that).

  • Workaround for storing persistent objects I have persistent storage?

    I am storing configuration of sorts data in the persistent storage XML definitions and other data of type string.

    These data are read from a server when the application is installed and can also be requested by the user.

    It is stored in a hash table for the simple extraction and hash tables are saved in persistent storage, works well.

    Except for storing images that come in the format of png og files are not persistables. Who discovered the way lasts :-)

    Is there a way around this problem? All this data is delivered in a zip file from the server and everything is unpacked on the SD card. So is it possible to "turn" or "wrap" these png files so they can be stored in a persistent storage? Save them on the SD card are ok for temporary storage, but for 'permanent' storage, I like to keep in a persistent storage.

    arrays of bytes must be persistent.
    You can use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/EncodedImage.html#getDa... to get bytes from an image, and you have already mentioned how to get it back.

    store in sqllite work similar.

  • Use a persistent storage or other methods to synchronize

    I have a user interface class that communicates with a background class by sending commands with world events to the base class. Two of them also uses a persistent storage.

    A simple method to retrieve return values could be to use a persistent as this storage:

    The user interface does:

    1 clears the back entrance in a persistent storage

    2 send the world event.

    3. going in a loop with a Thread.sleep and check if the back entrance is always empty

    After a number of loops decides that no response will be provided.

    The background task does:

    1 housing starts by accessing persistent storage in order to block with synchronization

    2 performs at the request of action

    3 put the result in the return of persistent storage field

    4 out of sync

    It sorts of handset return results and waiting for results. If the background task is not there the user interface will break out of the loop with a blank back. The only uncontrolled situation would be if the background task fails

    along the way, but then I have other problems. I threw an eye to wait/notify, semaphores and others, but the easiest solution is to use a persistent storage, because it has been used in any case for return information.

    Or expertise in this forum suggest another approach?

    A single Thread.yield is very good indeed, but if you put the user interface in a loop, just treatment Thread.yield () and the test for completion, instead of blocking your Thread event you will be hogging your event Thread and the operating system can get mad that too.

    As to notify the Ui that a message has been processed, Yes, the Observer Interface to do this.

  • Error in persistent storage when the application update that happened.

    I've been struggling with the problem for a long time.

    MY application uses a persistent storage to store parameter information.

    But when I update my application from version 1 to version 2, number of items in my configuration page has been changed, which means the new version of the page layout will load and save some new stuff in a persistent storage that did not exist in the old persistent storage.

    Problem occurs when custorms update their request. How can we drag all the old stored information when users start to use the updated application?

    I see these three options:

    (a) the best thing to do is to delete the old application, which will get rid of the old persistent data.

    (b) create a 'version2' of you persisted object with a different name.  In your treatment of startup, you see if there is a version 1 object, and if so, migrate the setting of the object Version in 1 to your new object.

    (c) try to your compatible changes.  There are different ways to do this.  A way that is easy to understand is to persist a string, which is your options encode in XML format.  If you use an XML string, then you can add a new attribute to your new options - but the persistent object remains the same.

    I hope this helps.

  • ESXi host has no persistent storage / fsUUID is null

    Hello

    The issue I'm having involves a HP N40L Microserver w / local storage on a HP SmartArray P410 controller.  6 hard drives configured in a RAID10 array and the multitude of ESXi what OS runs on local USB.

    A recent issue w / the matrix raid caused a crash of the VMS resident and now "host ESXi has no persistent storage" message.

    I solved the problems of disk HARD w / table (replaced a disk), and the table is presented in the peripheral topic under "HP Serial Attached SCSIDisk.  ID is naa.600508b1001c8d82bf5f4a33f0e2bc04

    However, the data store does not appear in the tab of data warehouses.  I refreshed and restarted several times w / no success.

    This data store was run on an installation 5.1 ESXi (ISO custom HP) for a few years without problem.

    To try to solve the problem, I installed ESXi 6.0 U1 on a new USB stick which fortunately is now running in the Microserver but presenting the same behavior for the data store.

    Output of list of file system of storage of esxcli-

    Mount point Name of volume UUID Type of mounting Size Free

    -------------------------------------------------  -----------  -----------------------------------  -------  ----  ---------  ---------

    / vmfs/volumes/56b8f1c5-732f51cf-68ec-a0b3cce4eb3a 56b8f1c5-732f51cf-68ec-a0b3cce4eb3a 299712512 88342528 true VFAT
    / vmfs/volumes/bd8588e2 - 04362b 85 - E425 - db3beeb1519c bd8588e2 - 04362b 85 - e425 - db3beeb1519c 261853184 261844992 true VFAT
    / vmfs/volumes/fd2695e7 - 253111b 8 - b8f2 - 4a0b47e4542e fd2695e7 - 253111b 8 - b8f2 - 4a0b47e4542e 261853184 69287936 true VFAT

    Esxcfg-scsidevs output - c-

    UID device Type of device The console device Size Multipathing PluginDisplay name
    MPX.vmhba32:C0:t0:l0 Direct access /VMFS/devices/disks/MPX.vmhba32:C0:t0:l0 Mo 15484 NMP USB Direct-access local (mpx.vmhba32:C0:T0:L0)
    NAA.600508b1001c8d82bf5f4a33f0e2bc04 Direct access 11446225MBNMP Serial Attached SCSI disk HP (naa.600508b1001c8d82bf5f4a33f0e2bc04)

    I'm trying to go back through the list of commands, I tried to get more information and at some point received a response from "fsUUID is null" when you try to search the naa identifier.

    All the input welcome, thank you.

    Please tell me what FreeNas has to do with this?
    I'd say we look closer together. If you want to - call me through Skype
    Ulli

  • Help: The ESXi host has no persistent storage

    We have an ESXI 5.0 installed on our Dell server and we have some virtual machines running. suddenly, we had a mistake on Vsphere client.

    "EXSI host has no persistent storage.

    To run the virtual machine, create at least a data store for the maintenance of the machines virtual and other system files. »

    to resolve this problem, so we tried.

    On Vsphere client (connected to the ESXI)-> configuration-> storage-> rescan all... once the re-scanner has been done.

    We are able to see the file was mounted on the data store and it is lost in a minute. so it isn't permanently mounted to the data store to access the virtual machine.

    Once we do the re-scan once again, we saw that the file has been fitted to the data store and lost again.

    assemble and disassemble is to continue to switch.

    We need a solution to fix the problem, or in the worst case we need a way to recover the Esxi machine (VMS) data.

    Kindly share the reflections.

    It should be a disk error, it is local storage that tempt you and the virtual machine files are stored in the local disk

    don't forget to check the logs on the bit/ucs, regardless of the remote management tool, you use...

    Please check the log files and vobd.log vmkernel

  • Server has no persistent storage

    I installed ESXi 3.5 for testing purposes and once I downloaded and ran the VMware Infrastructure Client, I get the message, "VMware ESX server has no persistent storage." As this is the first time I saw, and still less used VMware, I'm confused on what I should do next. Any help or advice would be greatly appreciated.

    Thank you.

    For Windows 2003 and 2008, it is not necessary, because the drivers for the virtual SCSI controller by default are already included on installation CD/DVD.

    André

    BTW: If you consider any answer correct or useful, please mark it as such to help other users with similar problems.

  • I have 50 GB of iCloud and my computer is full because of photo storage problems. How can I get these pictures in my icloud? I checked all my settings. Everything is as it should be. I feel as if I had downloaded originals or something.

    I have 50 GB of iCloud and my computer is full because of photo storage problems. How can I get these pictures in my icloud? I checked all my settings. Everything is as it should be. I feel as if I had downloaded originals or something. I don't know how to understand it. I Googled, I tried to get on my computer. Emptied my Recycle Bin and my download folder. I know I must be missing something.

    We need to switch to "Optimize the storage of Mac", see it - http://www.imore.com/how-save-space-optimized-storage-and-icloud-photo-library

  • iPhone storage problems

    Hello, I have storage problems with my iPhone 6. I have the 16 GB model and it seems to be showing me that I used more storage than I actually have. Under the management of storage in the settings section it says I used 11.6 GB and have 83.1 MB of available space. However when I add up the use of the storage for each application he ads only up to about 2.5 GB. In addition, on iTunes on my MacBook, it shows that I have 6.65 GB free. I tired delete apps and optimize Photos stroage and elimination of most local music from the phone. It was me that more sotrage space however when I checked later return that he had exhausted more storage without having downloaded me all the apps, photos, or music.

    iTunes and iOS do not display the use of storage the same way. The best way to ensure that the iPhone is deleted unnecessary files, including video streaming, old app data, etc., is to perform a restore. Make sure that the backup you make in iTunes is encrypted, so all of your critical data is kept. Import all your photos, music, too.

    Restore your iPhone, iPad or iPod touch from a backup - Apple Support

  • Anyone having problems with iOS 9.2.1? Storage problems, apps not working?

    Anyone having problems with iOS 9.2.1? Storage problems, apps not working?

    No, not at all. Maybe if your were to describe the issues a little more in detail, someone might be able to help.

  • iPhone 6 How to erase pictures off bot phone not cloud... storage problem

    How to delete all my photos my phone is turned off, but NOT out of the cloud... I have an iPhone 6 and have storage problems?

    It's complicated because if you have iCloud photo library, then no matter what in iCloud will always be visible and taking place on your phone.

    The best option is to choose the option 'OPTIMIZE the PHOTOS' in the settings Photos & the phone camera.

    This will keep a smaller version of the photo on your phone with the full version on iCloud.

    If you already have the option optimize running and you are still low on space, so the only thing to do is to delete some that are sitting in iCloud. It will then take even the version optimized on the phone.

  • Store the object in a persistent storage

    Hello

    I want to store the cusom object in the persistent store.here is my custom class:

    public class {UserData

    OrgName string;
    Time to string;
    String authTocken;
    Public UserData (orgName, String authTocken, String time, String)
    {
    this.orgName = orgName;
    This.Time = time;
    this.authTocken = authTocken;

    }
    public String getOrgName() {}
    return orgName;
    }
    {} public void setOrgName (String orgName)
    this.orgName = orgName;
    }
    public String getTime() {}
    back in time;
    }
    {} public void setTime (string time)
    This.Time = time;
    }
    public String getAuthTocken() {}
    Return authTocken;
    }
    {} public void setAuthTocken (String authTocken)
    this.authTocken = authTocken;
    }

    }

    and I use the following class of persistent storage to store the data.

    / public final class PersistentStoreContents implements {Persistable
    private CAMailMinderHashTable mElements = null;
    static private instance of PersistentStoreContents = null;
    Private static final long KEY = 0x67c5b66a2bcd1dfcL;
    private PersistentObject persistentObject = null;

    /**
    * Gets the single instance of the database.
    *
    * only @return of the database instance
    */
    public static getInstance() {} PersistentStoreContents
    try {}
    If (instance == null) {}
    Logger.out ("PersistentStoreInfo", "creation of the storage object");
    instance = new PersistentStoreContents();
    }
    } catch (Exception e) {}
    instance = null;
    }
    return instance;
    }

    private PersistentStoreContents() {}
    persistentObject = PersistentStore.getPersistentObject (KEY);
    synchronized (persistentObject) {}
    If (persistentObject.getContents () == null) {}
    persistentObject.setContents (new CAMailMinderHashTable());
    persistentObject.commit ();
    }
    }

    mElements = persistentObject.getContents ((CAMailMinderHashTable));
    If (mElements == null) {}
    Logger.out ("PersistentStoreInfo", "*" + (mElements is nothing));
    mElements = new CAMailMinderHashTable();
    }

    }

    public String getElement (String key) {}
    Logger.out ("PersistentStoreInfo", "getElement:" + key);
    Return (String) mElements.get (key);
    }

    ' Public Sub setElement (String key, String value) {}
    Logger.out ("PersistentStoreInfo", "setElement:" + key + value);
    mElements.put (key, value);
    persistentObject.setContents (mElements);
    persistentObject.commit ();
    }

    UserData public getElement2 (String key) {}
    Logger.out ("PersistentStoreInfo", "getElement:" + key);
    Return mElements.get (key) (UserData);
    }

    public void setElement2 (String key, UserData userData) {}
    Logger.out ("PersistentStoreInfo", "setElement:" + key);
    mElements.put (key, userData);
    Logger.out ("PersistentStoreInfo", "added");
    persistentObject.setContents (mElements);
    Logger.out ("PersistentStoreInfo", "game content");
    persistentObject.commit ();
    Logger.out ("PersistentStoreInfo", "Validate");
    }

    Public list getAllKeys() {}
    Logger.out ("PersistentStoreInfo", "getElement:" + key);
    Return mElements.keys ();
    }
    }

    I use the follwinng code to insert data :

    PersistentStoreContents ch = PersistentStoreContents.getInstance ();
    UserData = us new UserData("gmail.com","1111","aaaa");
    ps.setElement2 ("[email protected]", US);

    But it is not inserting data in the persistent store. App is struck to the persistent store setContent method... any idea on this?

    the object you put in the store has implemented persistable, not your utility class.

Maybe you are looking for

  • WHERE IS THE REAL FORUM? I CAN NOT FIND!

    Earlier, I installed the latest version of Firefox and, now, the order of bars, working downwards, is... 1 bar.2. tab bar.3. navigation bar.4. bookmarks toolbar. .. When I don't have the tab bar UNDER the bookmarks toolbar, where I still have it. How

  • Wake up the Qosmio F50 - 10G system mode 'sleep' and boots account locked window

    Why when the laptop is put to sleep and left for a while, flashing light and stops when you press the power button / laptop will wake up showing the BIOS screen then boots in the window account locked? Why I get this is event viewer? Source ACPIThe e

  • Expression evaluation limits step

    I'm just trying to understand the point at which the step limits expression is evaluated. I'm trying to define the limits of a test of numerical limit based on an expression. I'm passing the context of the sequence for the LabVIEW code module so that

  • code 740 - create process failed - requires a rise

    problems with pc games download

  • HP B210a (printer all-in-one) won't turn off

    I am not able to turn off my printer without pulling on the power supply.  When I press the power switch / screen indicates that the printer is 'close', but it does not turn off. Plug the printer back in after having removed the power supply causes t