ObjectGroup and NonPersistableObjectException

I'm trying to reduce my handles in memory by using the ObjectGroup.createGroup () on an array of objects.  JDE 4.1 documentation says nothing on objects that need to be Persistable or that a NonPersistableObjectException can be lifted.  The JDE 4.3 mentions in the intro to the class that he is persistent, but doesn't mention the exception.

Is there a way to group non-persistent objects?

Thank you

Philippe

I think that the only reason why they put in the Persistable obligation is therefore to make the programmer know what items may be copied (in the hope, the user takes care and limit the number of objects peristable, preventing the accidental inclusion of large trees of objects).  Otherwise, it seems to be an unnecessary restriction (I've added a bunch of "Persistable implements" but never persist objects and it seems to work).

Thank you

Philippe

Tags: BlackBerry Developers

Similar Questions

  • 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.

  • NonPersistableObjectException

    Hi people,

    I get this error on the subject, when I try to open an httpconnection, strange isn't? rsrs... under my PersistenceClass:

    [code]

    package mypackage;
    import net.rim.device.api.system.PersistentObject; import net.rim.device.api.system.PersistentStore;
    Class DataPersistance {}
    Private Shared DataPersistance dataPersistance;    private static PersistentObject persistentObject.    settingsTable private static Hashtable;
    Continue the implementation... private DataPersistance() {}
    Hash of examples.persistentstore.
    persistentObject = PersistentStore.getPersistentObject (0xc80c1e32);
    {Synchronized (persistentObject)}
    settingsTable = persistentObject.getContents () (Hashtable);        If (null == settingsTable) {settingsTable = new Hashtable();            persistentObject.setContents (settingsTable);            persistentObject.commit ();        }        // }    }
    public {get {Object (String key) {/ / settingsTable = persistentObject.getContents () (Hashtable);}}}        Return settingsTable.get (key);    }
    public void set (String key, Object value) {if (value == null) {settingsTable.remove (key);}        } else {settingsTable.put (key, value);        }
    }
    public void commit() {try {synchronized (persistentObject) {persistentObject.setContents (settingsTable);}                persistentObject.commit ();            }
    } catch (System.Exception e) {e.printStackTrace ();            System.out.println ("PERSISTENCE of EXCEPTION:" + e.getClass () + "" + e.getMessage ());        }    }
    public static DataPersistance getInstance() {if (dataPersistance! = null) {System.out.println ("retornando um DataPersistance ja existente.");}            Return dataPersistance;        } else {System.out.println ("instanciando um DataPersistance.");            dataPersistance = new DataPersistance();            Return dataPersistance;        }    }
    }

    [/ code]

    Why get this error on a COnnection.open? I don't have to commit to anything, don't getContents();

    Thank you

    I am very confused.  If you don't keep all objects, so how can you have a NonPersistableObjectException?

    We see in the code that you create an empty hash table and it is persistent.  Hashtable is persistent.  So this will not cause your problem.  So it seems logical that you have in fact, directly or not, add an object to the list of objects to be persisted.  You can do this without knowing it.  If you add the object to the hash table and object has a reference to object B, then it will also persist object B.  A, otherwise it won't be able to recreate the object A.  Now maybe object A is Persistable (like the hash table) but is not object B.  This causes the problem.

    So, as I said before you have to go through all the ' together do you and know what objects you are directly and indirectly adding to PersistentStore.

    I have another change of code to suggest that, in my opinion, could well help to find this problem.  in your

    Public Sub set (...)

    method, add a call to commit.  This will attempt to commit as soon as you add an object.  And you will likely (but not guaranteed to be 100%) to have this failure on the object that you add, and that is not persistent.

    I do not understand why you have given us your connection class.  What is there to do with the problem?

    Finally, if you hover over the icons in the tool bar layout you see when you create a message, you will see tooltips.  Icons will say "Insert Code".  Press and paste the code into the window that opens.  Do it after you have checked your post, as it used to be that the spellcheck spoiled some of the formatting of the code.

  • NonPersistableObjectException on commit () [code]

    I use the following data record to store relevant data as a persistent object:

    [code]

    Import packages
    Net.rim.device.api.util import. *;
    Import Java.util;

    / public class SentBM_Data implements Persistable
    {
    Private members
     
    Public members
    public int ID;
    public boolean initialized = false;
    public int PIN;
    public Vector storedPackets;         Datagram
    public Vector brokenServer;          Byte]
     
    Builders
    public SentBM_Data)
    {
    for (int count = 0; count)< 50;="">
    {
    Debugging
    System.out.println ("created data object");
    }
        
    storedPackets = new Vector (1, 1);
    brokenServer = new Vector (1, 1);
    }
     
    public SentBM_Data (int boxID)
    {
    Debugging
    System.out.println ("created data object");
        
    storedPackets = new Vector (1);
    brokenServer = new Vector (1, 1);
        
    ID = boxID;
    }
     
    public static generateID Sub)
    {
    TODO: Check in with the BlackBerry PIN
    TODO: set the ID field to the returned boxID (default if PIN invalid)
    }
     
    public String toString)
    {
    String content = "";
        
    content += "case ID:"+ ID + "\n"; '.
    content += "Initialized?:" + initialized + "\n"; "."
    content += "PIN:" + PIN + "/ n"; "."
    content += "Unbuilt stored packages:"+ brokenServer.size () + "\n"; '.
    content += "built the stored packages:"+ storedPackets.size () + "\n"; '.
        
    return the content;
    }
    }

    [/ code]

    I have an appData global object of the type SentBM_Data in which I make the changes and use the following code to commit the changes:

    [code]

    synchronized (BSMData)
    {
    BSMData.setContents (appData);
    BSMData.commit ();
    }

    [/ code]

    For some reason any him commit this change started recently throw a NonPersistableObjectException, even a new run (flash memory at the start of simulator of compensation). I was getting this error before, and I've changed anything which involves the recording of the above data and receive this error message. Any ideas?

    Current Simulator: Bold 9000

    EDIT: I should mention that I use Eclipse version 3.4.1 with plugin 1.0.0.67 version

    Make a differential diagnosis in commenting on the two carriers first and see if you can store the object.

    If it works, comment in the vector with the Byte [] and if it works comment back of the vector with the object of datagram, if it fails, then you know why.

    Looking through the JavaDoc, you will find the following elements of the Persistable interface

    A class must explicitly implement this interface for the system store instances of the persistent class. Make the subfamily (s) not inherit implementation of this interface.

    Class DatagramBase (that implements the datagram that implements Persistable new) does not implement explicitly Persistable not it he inherited only from its super class DataBuffer, which means according to the JavaDoc comment above, that DatagramBase objects are not persitable.

  • Where to apply for ObjectGroup on an object persist with a table structure? Level line or set of table?

    Hi, expert,

    We have a class like this structure to store a table like structure in the persistent store:

    class {} table

    Vector lines; vector line, each line is another vector for the columns.

    PrimaryKeyMaps Hashtable;

    String tableName;

    }

    We know that we should use ObjectGroup to save persisent object handle. Right now, I use the group for each line vector object (all columns in a row are grouped). If each line would consume only a handful of persistent object. I guess I should group the primaryKeyMaps as well. However I wonder if I need to group them at the level of the entire table or not, because if there are 50 rows to the table, I would use 50 handler object persistent for all these lines. Managers how persisetent demand would be reasonably use in general? What is a good balance between performance and keeping the persistent object handles?

    I use a very similar structure to store Tables in PersistentStore, and I grouped by row (I do not use Group objects, I essentially to serialize the row)... But that's all.  And I have a large number of lines in a number of tables, certainly more than 10,000 usually.  Works very well.

    Persistent used to be a big problem, but I think you'll find that it isn't now, so unless you are targeting devices used (pre OS 4.6), or you have more than 10 s of thousands of lines, then I think that the structure, you are currently to assistance is therefore probably good enough.  And if you become big, you should probably move the data to SQLite.

    I'm a little concerned by the hash table you mind, I have not this and it is more than double the number of persistent Handles because you have an object for the key and the value.  have you looked to optimize this, perhaps using an intHashTable to kill using object?

    But if you are looking for where you will not store 10s of thousands and thousands of lines, I think what you do is very well.

  • I have an ipod touch 128 GB... but I'm almost to reach its maximum.  I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with other copies

    I have an ipod touch 128 GB... but I'm almost to reach its maximum.

    I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with the other copies of the other.

    is this possible?

    What should I do?

    Matt

    When you get the new iPod, you can use iTunes on your computer to select and synchronize the music you want on it, in the same way that you synchronize your current iPod - your iTunes will recognize them as different devices and will remember your choice of synchronization for each, it will not (unless, for example, you restore the backup of your current on her iPod) put the same content on both.

    (I asked for your post be moved to the iPod Touch forum, where you have posted is the iPad forum use.)

  • Why my notes sync between my Mac and iPhone?

    I have my MacBook Pro with Mac OS X 10.9.5 Mavericks and my iPhone is running iOS 10.0.1 and used to synchronize my notes! Is it because of the huge gap in operating systems? I SHOULD update my Mac to Mac OS 10.10 + for this problem? Thank you!

    In order to synchronize Notes between your Mac and iPhone, you must configure iCloud > http://www.apple.com/icloud/setup/

    But this requires macOS Sierra 10.12, the latest available version and the last iOS available for your iPhone.

  • Photos, iCloud and OneDrive sync

    Hi all

    I have a question on how to better organize my photo library.

    For the moment, on my space OneDrive (mapped to a partition on my MacBook SSD), I have a folder called 'Images' containing just about all of my photos and organized by folders.

    Since my tech ecosystem is roughly marked Apple (iPhone, iPad and MacBook), I would use the power and versatility of the Photos and iCloud, so that everything remains in all of my devices and free space memory iPhone sync.

    Here's the question: I want to keep my pictures saved on OneDrive, then put the Photos on my Mac to view photos from this folder and use iCloud to share through my devices.

    -I see the same folder structure on iPhone and iPad a synchronization is complete?

    -More important, if I take a picture with my iPad, it will be placed not only on iCloud but also automatically added pictures on Mac which, in turn, puts it in the folder of photos on my OneDrive?

    -Finally, take pictures of my iDevices will store them in the film. If I move them into folders, photos will be mapped (copied to iCloud) on my other devices constantly (in the folder)?

    I would like to notice I'm not trying to avoid using iCloud premium space - I already have a subscription plan of 50 GB that I don't mind mounted. I just keep having just all my photos on OneDrive.

    Thank you in advance for any comments you may have!

    Paul

    The answer is simply not

    The photo library can not be stored on a basic system to pictures not work will have a referenced library, so you may not have a local library references photos on a disc - the photo library can be on a local drive connected directly to the Mac OS Extended format

    You can synchronize between the Mac and IOS devices using iCloud library that synchronizes the photos and the structure of the album/folder between devices

    When you import pictures you can export them to your OneDrive record and have a copy (not associate Photos somehow) on a disk

    You can not have the same physical pictures in Photos and on one disc - each must have its own copy of the Photo

    http://www.Apple.com/icloud/photos/

    LN

  • Video and photos of backup

    Hello

    Anyone know the best way to back up photos and videos I took Iphone 6 my mom.

    I just got a new Iphone 6 more and have an icloud account, she has one more.  I don't know how to proceed.

    Thank you

    This article can help you:

    The backup of your iPhone, iPad and iPod touch - Apple Support

    You get free 5 GB of storage iCloud. If you want to save more than 5 GB, you buy more storage iCloud.

  • I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    You can use it with your TV.

  • I need to change my security issues and said we do not have enough information to reset your

    I need to change my security but said Questions we have insufficient information to reset security of your apple ID questions.my is [email protected] I want to slove this problem please help me

    You should contact the account of Apple security team. To join, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (145174)

  • Updated for Sierra and cannot import images

    I upgraded to Sierra and my camera, a Canon EOS 20 d is is properly recognized.

    Prior to the upgrade:

    When I plugged the camera would open automatically. I close and open Photoshop. PS I would like to select Import-> device and my camera would be identified. When I select the camer displayed thumbnails of photo.

    After the upgrade:

    When I connect the camera pictures only opens automaticall. If I open the pictures is not a camera attached.

    PS when I select Import-> my camera device is represented, but the icon is an external drive. When I select the icon nothing is displayed.

    Hello ChuckSto,

    Thank you for using communities Support from Apple. I know have a problem with your Mac and your camera is not what you expect. The good news is that the next steps will be useful for your problem of your camera is not recognized:

    If nothing happens when you connect your digital camera

    Try the following:

    • Make sure that the USB cable is properly connected to your camera and computer. If your computer has a USB port, try connecting the cable inside.

    • Check your camera to make sure he turned on and set to mode suitable for importing the photos. See the instructions that came with your camera.

    • Check the memory card of your camera for damage. See the documentation that came with your camera for more information on this page or other potential problems.

    Photos for Mac: import pictures from a camera or a mobile device

    See you soon!

  • Speeches and a .key file cannot be opened

    I'm unable to open or work on Keynote documents. I get an error popup image that says: cannot open 'FILE.key' because it is not a valid document to Keynote. I'm assuming that the same problem will occur in numbers and pages so I have not used either of these programs in a very long time so I do not have a file to test on.

    I know that the file is indeed a valid Keynote document. I recently had to reinstall my package iWork 09 since the original software discs - I have them have not purchased through the App store or my iCloud account. I have a software key. I can't move my OS to Sierra right now because I have other software that I use for work and tech support as we said we cannot go immediately. My current OS is El Capitan 10.11.6, and I have a MacBook Pro 15 "retina.

    Any advice on obtaining Keynote works again until I can make the upgrade to Sierra?

    Thanks in advance.

    Sounds like you are trying use Keynote 09 to open a file created by Keynote 6.

    Keynote 09 cannot open files of version 6 because they are a different file format.

    If this is the case, buy and install Keynote 6 from the Mac App Store.

  • Universal SE Clipboard and iPhone

    Universal Clipboard will work between a MBP of the retina and an iPhone SE?

    Hello curly1,.

    Thank you for using communities of Apple Support. It is my understanding that you want to use the universal Clipboard between your MacBook Pro and the iPhone OS. This is a great feature. I'm happy to help you.

    Universal Clipboard

    Universal Clipboard works with these devices and operating systems:

    iOS 10 macOS Sierra
    • iPhone 5 or newer
    • iPad Pro
    • iPad (4th generation)
    • iPad Air or newer
    • Mini iPad 2 or newer
    • iPod touch (6th generation) or newer

    • MacBook (early 2015 or newer)
    • MacBook Pro (2012 or newer)
    • MacBook Air (2012 or newer)
    • Mac mini (2012 or newer)
    • iMac (2012 or newer)
    • Mac Pro (end 2013)

    Requirements for continuity on Mac, iPhone, iPad, iPod touch and Apple Watch

    Have an amazing day!

  • USB disabled after the update of the Sierra (a short circuit and a work)

    Hi, when I bought my mbp 13 inches mid2012 (used, not new) I noticed that a USB port did not work. In the Yosemite sometimes I noticed that a USB port consumed too much energy and have been disabled. (I think because the usb port has been short-circuited. Year when it was time to update the mbp to El Capitan I had a few panic the kernel and the newspaper was shown as the last driver loaded the USB driver, so I kept the mbp with Yosemite. A few days ago, I updated for Sierra but only usb which used to work stopped working. It has enabled and turned on but Finder and disk utility does not see the drive. In an Apple dealer they said that could be established relationships with some oxide and next week will take it and see what the problem is.

    If there is someone with the same problems, please tell me what to do! I don't want to put in the trash my mac just for a flash drive... but I need!

    Hi Supermene,

    Thank you for using communities of Apple Support. Based on what you said, it appears as a USB device is not recognized in one of the USB ports. There are a few things that can cause this. I recommend you read these articles, which may be able to help solve the problem.

    macOS Sierra: If a USB device does not work

    Reset the management system (SCM) controller on your Mac.

    See you soon.

Maybe you are looking for