How do I solve the NonPersistableObjectException

I have a method that is simple, written in the form:

Public Shared Sub set (long uniqueId, String value) {}
Store = PersistentStore.getPersistentObject (uniqueId);
synchronized (store) {}
store.setContents (value);
Store.Commit ();
}
}

This method works very well for the first time, but the second time, it will fail with NonPersistableObjectException.

Point to be noted is that same unique identification number, I'm updating with the same value.

You have created an object that extends the string that you store?  If so, you will need to implement Persistable in this object.

Your own object is also a good idea.  But there is a problem with persistent objects when you upgrade the.  Say, you create an object as follows:

class MyPersistentObject extends Persistable {}

String _string1 = null;

String _string2 = null;

....

String getString1() {}

Return _string1;

}

...

}

Now for V2, you want to add another string, so you must

class MyPersistentObject extends Persistable {}

String _string1 = null;

String _string2 = null;

String _string3 = null;

....

String getString3() {}

Return _string3;

}

...

}

Now because you have changed the structure of this persistent object, you actually have the persistent class on the incompatible device with your upgrade.  To install, users will have to delete the old application, lose the stored data.

However if you did to begin with:

class myPersistedObject extends IntHashTable implements Persistable {}

...

String getString1() {}

Return this.get (1);

}

....

}

Then to add another channel, you simply add the get method:

class myPersistedObject extends IntHashTable implements Persistable {}

...

String getString3() {}

Return this.get (3);

}

....

}

The structure does not change and it is compatible.

The above code is NOT correct, I hope you get the idea.

Then create your own class, but extends a Collection object and you get the flexibility and scalability.

Hope it makes sense.

Tags: BlackBerry Developers

Similar Questions

  • I forgot my secret question to apple id answer... How could I solve the problem?

    I forgot my secret question to apple id answer... How could I solve the problem?

    Hello

    If you set an alternate e-mail address, you can reset your security questions. Follow the instructions here to check if this option is available:

    - If you forgot your Apple ID - Apple Support security questions answered

    Otherwise, you will need to contact the Apple Support. The information is available here:

    - Contact Apple for assistance with the security of the Apple ID - Apple Support accounts

    (I'm afraid that no one here can reset security for you - it is a community based on the user, not the Apple Support).

  • I am trying to add itunes to an old computer for my kids. It has the windows xp operating system. problem of Setup Windows how can I solve the problem?

    I am trying to add itunes to an old computer for my kids. It has the windows xp operating system.  When I try to install itunes, I get an error message that says: I'm having problems with my windows installer.  I don't have an existing copy of itunes on the computer that would be a new installation.   How can I solve the problem?  I have a new computer with windows 7 and had no problem with installation on it.

    If you can not receive answers that will solve your problem, I would suggest that repost you to...

    Cummunities to Support Apple - itunes for Windows:

    https://discussions.Apple.com/community/iTunes/itunes_for_windows

  • How do you solve the problem when you get "There is an IP address conflict"?

    How do you solve the problem when you get "There is an IP address conflict"?

    How can someone else have a computer with the same IP address?  Is this possible?  How do you get them?  Thank you

    I recvd a phone call yesterday telling me I had a computer at risk with the help of the same IP address or ID in China.  I thought it was a hoax.  They said they came from Microsoft, but when I tried to recall today, there was a message stating that the Group was not available.  Then I get on my computer and get the label "there is an IP address conflict" and I panic, what happens if someone in China is using my computer?  How can I stop this?  I ran antivirus and anything analyses.    Help, please?

    To resolve IP conflicts restart all computers, peripheral and the router at the same time.  Chances are it will fix

    Microsoft (or any other reliable service)'ll never call you cold.  They have no idea if your computer is in danger, a virus or anything else.  Calls are cold almost always a scam.

  • Webshots will install in Windows 7 Professional, how can I solve the problem?

    Webshots will install in Windows 7 Professional, how can I solve the problem?  (The installation program starts to run, then it is de-energized and does nothing.)

    Hi Bill,

    You are able to install other programs on the computer?

    There is no information available as to the compatibility of Webshots with Windows 7.
    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/search.aspx?l=en-us&type=software&s=Webshots%20&OS=32-bit

    I suggest you to follow the steps and check if it helps.

    Method 1: Follow the steps in the link and check if that helps.

    Diagnose and solve the program installation and uninstallation problems automatically

    Method 2: You can also try to follow the steps in the link and check if it helps.

    Problems installing and uninstalling programs on Windows computers

  • How can I solve the error 16 when I try to install a program?

    How can I solve the error 16 when I try to install a program?

    In Adobe Creative Suite or Adobe Creative Cloud configuration error

  • I replaced my hard drive and format my computer before turning off the software PS.  It need my code series now, but I had lost.  How can I solve the problem and use the software again?

    I replaced my hard drive and format my computer before turning off the software PS.  It need my code series now, but I had lost.

    How can I solve the problem and use the software again?

    If you use a perpetual Photoshop and formatted your disc version of starting without disabling your activation of Photoshop, you also Adobe supports help you activate Photoshop once you retrieve your serial number.  The startup disk formatting would destroy that credential of Activation Photoshop machine which is registered in the database of the Adobe activation server. Which reduces the activation numbers you have to use.  If you have Photoshop installed on a second computer that means that you have no free activation available as well, even with your key you can't activated the machine.

  • HOW CAN I SOLVE THE PROBLEM, "FIREFOX IS INCOMPATIBLE" IN MY FIREFOX TROUBLESHOOTING REPORT?

    On my desk when I click on the firefox icon, pops up 'USER ACCOUNT CONTROL' - DO YOU WANT TO ALLOW THE FOLLOWING GUIDELINES
    PROGRAM TO MOVE TO THIS COMPUTER? (the program name is firefox). I click 'YES' and my opening page appears.
    This, the only way I can access my portable browser which is firefox. In case of problem report says "Firefox IS INCOMPATIBLE.
    HOW CAN I SOLVE THIS PROBLEM? Thank you.

    KENNETHM said

    Hi Sashoto:
    Because I'm not a computer genius I forgot an important part of the info
    I have WINDOWS 7 Home Edition NOT in WINDOWS XP. That's why I think
    This version of FIREFOX UPDATE 36 should work with WINDOWS 7. All new
    recommendations for a solution to my problem? Thank you!

    Please follow these steps and let me know if these work:

    • Open the Windows Task Manager
    • Click the process tab
    • Click on show processes from all users
    • You may be prompted for confirmation. Say yes, or type the password.
    • Search for firefox.exe or similar process
    • Right-click on the process and select end process tree
    • Now, open computer > (c :)) drive > Program Files (x 86) > Mozilla Firefox > uninstall > helper.exe)
    • Run the installer-United Nations
    • Restart your PC
    • Reinstall Mozilla Firefox
  • Help! How can I solve the problem of synchronization on my XP?

    The clock on my HP XP jumps always six minutes fast despite synchronization with the internet every week! How can I fix?

    Hi Adam,.

    Sorry to hear about the issue. I arrived to find those articles that should help you to solve the problem here.

    First, follow the steps in this article. See how it goes.

    If this is insufficient, install the hotfix article to see if it corrects the problem.

    I hope this helps!

  • I can not watch videos on my pc, how can I solve the problem.

    When I go to You Tube any of the videos will show, it is a black space.

    Hello

    1 is this number reserved only to online videos?
    2. what internet browser do you use?

    Method 1.
    Try to play another video on youtube and check.

     
    Method 2.
    Given that most online videos require Adobe flash to work I suggest you install Adobe Flash player in Internet Explorer.
    I recommend you update Adobe flash player on the website below:
    http://get.Adobe.com/flashplayer/
     
    Method 3.
    a. If the problem persists, you can optimize Internet Explorer.
    See the link below for more information.
    How to optimize Internet Explorer?
    http://support.Microsoft.com/kb/936213
     
    b. If nothing works to solve the issue try reset Internet Explorer.
    How to reset Internet explorer:
    http://support.Microsoft.com/kb/923737
    Note: After resetting Internet explorer you will need to install the Adobe flash again.
    WARNING:
    Please note that reset the settings of Internet Explorer running resets all of the settings defined by the user, including those established by the installed extensions, toolbars and other add-ons for IE by default. This includes all the security, privacy and settings area. Also this will erase browsing history, delete all temporary Internet, cookies, form data files and especially all the passwords.
     
     
    I hope this helps.
  • I have replaced my hd, reinstalled the operating system, but you forgot to activate vista. How can I solve the problem?

    After that my hd, I decided to replace it as well as reinstall Vista Home Basic using the system recovery disk, that I bought at HP in 2007. My laptop is a pavilion dv6000 with Vista 32 bit.

    Unfortunately I didn't, I had to turn my copy of vista on my pc within 30 days, since I got my pc sometimes without incurring in this issue. I tried to insert the cd in the back of my pc key, but to understand that no longer works, so I tried with the new cd key of my drive to restore but that no longer works.

    How can I solve this problem?

    gscarabel wrote:

    After that my hd, I decided to replace it as well as reinstall Vista Home Basic using the system recovery disk, that I bought at HP in 2007. My laptop is a pavilion dv6000 with Vista 32 bit.

    Unfortunately I didn't, I had to turn my copy of vista on my pc within 30 days, since I got my pc sometimes without incurring in this issue. I tried to insert the cd in the back of my pc key, but to understand that no longer works, so I tried with the new cd key of my drive to restore but that no longer works.

    How can I solve this problem?

    Hello

    Call Microsoft and tell them about this. The operating system is a version OEM and MS should help you...

  • What does "cannot write: c: / program files/dell support center/imstrayicon" means and how can I solve the problem

    What does "cannot write: c: / program files/dell support central/imstrayicon" mean and how do I remove the note from my screen or solve the problem

    Hi Thomas,

    1. when exactly you get this message?

    2. this happens to you on starup windows or when you try to use a specific program?

    3. did you of recent changes on the computer?

    This seems to be an error related to the centre of Dell Support.

    Step 1:

    If you receive at the start, then you can try to disable any support Dell Center entries in startup items and see if it helps.

    a. Click Start, type msconfig.exe in the start search, and then press ENTER.

    b. click on the Startup tab and uncheck then the program in the list.

    Hope this information is useful.

  • How do I solve the kcrtx86 down problem in Windows 7

    I have Tuneup utilities installed on my windows 7 and several times, she shows that a unit named "kcrtx86" in does not. If I restart once the problem is solved but to be returned after some time again. and a few reboot same time does not help.

    now, if a device does not work, a layman user like me doesn't have too much problem with the usual routine tasks except that my gadgets Google desktop crash from time to time & then and refused to restart :(

    In addition, although very few, but some of my apps randomly crash/stop work & I have to restart these applications.

    Hello

    Thanks for posting your question in the community of Microsoft Windows. I understand that you have a problem with kcrtx86. Correct me if I'm wrong.

    I imagine the inconvenience that you are experiencing. I will definitely help you with this.

    To help you suggest several steps to solve the problem, I would appreciate it if you could answer the following questions:

    1. you receive an error code or message?

    2. have you made any recent hardware or exchange of software on your computer before the show?

    3. Once you get the error message "kcrtx86 does not?

    Please follow the methods and mark the question below:

    Method 1:

     

    You need perform a clean boot to prevent any third party conflicting application from interfering with your computer.

    To put the computer in a clean boot state, you must follow the steps in the article mentioned below and check with the question.

     

    How to troubleshoot a problem by performing a clean boot in Windows Vista or Windows 7:
    http://support.Microsoft.com/kb/929135

    Note: You must follow step 7 of the article mentioned above to recover your computer to a Normal startup after you complete all the steps.

     

     

    Method 2:

     

    Scan your computer by using the Microsoft Safety Scanner by clicking Download now to check if there is no virus infected:

    http://www.microsoftsafetyscanner.com/

     

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

     

     

     

    Your response is very important for us to ensure a proper resolution. Please get back to us with the information above to help you accordingly.

  • I downloaded the acrobat on my iPhone and IPAD player, and when I want to open an attachment the reader is not an option. How can I solve the problem

    I downloaded Acrobat reader on my iPhone and IPAD. When I go to open an attachment, acrobat is not an option. How can I solve this problem?

    Hello

    What is the application you use to read email?  It's Apple Mail (the default mail on iPhone and iPad app)?

    Please take a look at the section "Open email" the following documents of the FAQ.

    How to open PDF documents in Adobe Acrobat DC for iOS (iPad version)

    How to open PDF documents in Adobe Acrobat DC for iOS (iPhone version)

    If Acrobat Reader for iOS is installed properly on your iPhone and iPad, Acrobat Reader should appear as one of the options for the iOS 'Open In' feature.

    Please let us know if you have any other questions.

  • Operating system windows vista, cannot create contact groups after the export contacts from another computer, how can I solve the problem

    I had surgery with vista and Windows mail and setting up the contact email groups, however I had someone export my 'contacts' to another computer that has worked on xp, since which time it is so more ease to set up groups.

    I tried for hours as a software specialist and can't seem to solve the problem

    Thanks for any help - Pleease

    David Rumsey

    Missing the Windows Contacts toolbar buttons
    http://www.vista4beginners.com/missing-buttons-from-Windows-contacts-toolbar

    Vista - "New Contact" and "Contact Group on new" button missing
    http://www.Vistax64.com/tutorials/186477-new-contact-new-contact-group-button-missing.html

Maybe you are looking for