Deleting persistent objects on uninstall

If an application defines a class that implements Persistable, all persistent objects of this class are deleted when the application is uninstalled. It is logical and it is clear from the documentation. What is not clear, is what happens if your application is still a standard container (for example, a hash table) that in turn contains a Persistable custom class instances. The container class is deleted also? I guess it must be, otherwise, it would end up by plenty of broken references.

Yes, it will also get deleted.

If your problem has been solved to then please mark the thread as "Accepted Solution" and congratulations - your wish

Tags: BlackBerry Developers

Similar Questions

  • Question about the persistent object

    Hello

    When I used to store data using persistent object, data also will be deleted after uninstalling the app.

    Is there any data keep possibility even if the app is uninstalled?

    Can anyone give me a suggestion on this?

    Thank you.

    Objects are deleted when no request refers to them.

    So, if you have implemented a custom persistable object, whis would explain the removal.

    Use "Vanilla" persistable objects in the store, such as Hashtable.

  • Deletes the objects with the mergeEntity function

    Hello

    I use Toplink with a façade of Session EJB.

    I have two tables (PERSON and ASSIGNMENTS). A person may have several missions. Now, I want to delete some assignments from a person. I want to do this by using a backingBean. My grain of support code looks something like this. In this scenario, I want to delete all assignments on a person.
    BACKING BEAN
    ...
    Person person = (Person)context.getApplication().evaluateExpressionGet(context, #{bindings.personCollectionIterator.currentRow.dataProvider) Person.class);
    
    DCBindingContainer bindings = (DCBindingContainer)getBindings();
    DCIteratorBinding dcIteratorBinding = (DCIteratorBinding)bindings.get("assignmentsCollectionterator");
    Row[] rowAssignments = dcIteratorBinding.getAllRowsInRange();
    
    for (int j=0; j<rowAssignments.length; j++) {
       Assignment assignment = (Assignment)((DCDataRow)rowAssignments[j]).getDataProvider();
       person.removeAssignment(assignment);
    }
    
    // update person
    bindings.getOperationBinding("mergePerson").execute();
    In my grain of support, everything works fine. The "person" entity is sent has the façade of the Session.
    SESSION FACADE
      public Object mergeEntity(Object entity) {
        UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
        Object workingCopy = uow.readObject(entity);
        if (workingCopy == null)
          throw new RuntimeException("Could not find entity to update");
        uow.deepMergeClone(entity);
        
        uow.commit();
    
        return workingCopy;
      }
    The entity in the façade of the Session has no assignment. What can I do to make this persistent state. The problem is that the assignments of the people in the database is deleted.

    Is it possible to do it this way. Why the wizzard created the removeAssignment feature if I can't use it in this scenario? I use uow.removeEntity, if I want to delete an assignment or is it also possible to use a feature of mergeClone?

    Thank you
    Brahim

    Hello

    When you delete an object from a normal relationship, you declare simply that the object should no longer be reference, deletion off all foreign key in question. If you want it deleted, you must explicitly he took.

    TopLink has the notion of private property, which can take care of that for you. When an object is removed from a private relationship, it will be marked to be deleted from the database as well. If you mark as private relationship, you get the behavior that you expect from the code that you have demonstrated.

    Best regards
    Chris

  • change the value of an object in the content of the persistent object

    Hello

    I'm triyin to make a customizable menu, saving the preferences of the user as a custom class in a hash table which is the content of my persistent object.

    the custom class "Favoritos" is like this:

    public class Favoritos implements Persistable {
          private Boolean[] misFavoritos = new Boolean[10];
    
          public Favoritos() {
            super();
        }
    
        public Boolean[] getMisFavoritos() {
            return misFavoritos;
        }
    
        public void setMisFavoritos(Boolean[] misFavoritos) {
            this.misFavoritos = misFavoritos;
        }
    }
    

    and the hash table custom:

    public class CustomHashtable extends Hashtable implements Persistable {
    
    }
    

    in my menu configuration screen, I show the options selected as Favorites, which are defined as true in Boolean Favoritos object table in the hashtable. I retrieve the values or set them all as false if they have not been registered before, like this:

    PersistentObject persistentObject = PersistentStore.getPersistentObject(KEY);
    if(persistentObject.getContents() != null){
        CustomHashtable persistentHashtable = (CustomHashtable) persistentObject.getContents();
        if(persistentHashtable.containsKey("misFavoritos")){
        misFavoritos = ((Favoritos) persistentHashtable.get("misFavoritos"));
        }
        else{
        misFavoritos = new Favoritos();
        Boolean[] f = {new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false),
                  new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(false)};
        misFavoritos.setMisFavoritos(f);
        persistentHashtable.put("misFavoritos", misFavoritos);
        persistentObject.commit();
        }
    }
    

    So I give to the user the possibility to define as true certain values and Boolean table, I try to change them this way:

    misFavoritos.getMisFavoritos()[i] = new Boolean(true);
    persistentHashtable.put("misFavoritos", misFavoritos);
    persistentObject.commit();
    

    Changes are persisted as I navigate the application, I want to say, if I close the configuration screen and open another configuration screen, changes of this show, but I I close application it loosse changes made a show all the elements of the array as false. What I do wrong?

    RuntimeStore is the other location people will such things, but it is cleared to restart the device, not the app.

    If you want to have something that you have to restart the application, then keep your storage apps and turn it off when leaving.

  • How to exclude the field of persistent object

    Hello

    Is it possible to substitute the PersistanceStore method to persist objects?

    I have a complex data structure I need to store. One of the internal classes contain no persistent field. When I'm storing the data I don't no need to store this field, but the compiler triggers error.

    ... Widget: error! : class... Persistable marked widget by interface:... Persistable is not persistent: _field field: class... Field does not implement net.rim.vm.Persistable

    Is the way to override the implementation of this class persitant and exclude the problematic areas?

    Thanks for the reply.

    I did something similar, I created a class of data for persistence and a class of execution with additional fields.

    It's not very practical, these classes are deep into a tree of complex data, but I guess that's how it should work with BlackBerry.

  • Doubt about the persistent object

    Hi friends,

    I've stored data object persistent after that some time, my Simulator has taken a lot of time to load the application so I run clear.bat do fast Simulator. But after I run clear.bat. The values of what I stored in the persistent object had disappeared. Someone at - he said, therefore, it is the persistent object data are parties to cause of the performer, the clear.bat or any other reason. pls clarify my doubt friends...

    Kind regards

    s.Kumaran.

    It is b'caz of clean.bat. Clean.bat will remove all applications and unnecessary files, etc...

  • Problem on persistent object.

    Hi friends,

    My Simulator take a long time to load a program I m using the jde4.5 version. If we run clear.bat then we can accelerate simulator but I store an object any on the persistent object. It is persistent any object data erase if I run clear.bat?... is there another way to save the persistent object and make our quick Simulator to load the program. M pls kindly help.

    Kind regards

    s.Kumaran.

    Yes, clean.bat also erases store persistent Simulator (it stored in the *.dmp file).

    But clean.bat takes a long time to run, because it removes all the additional files of the Simulator file system.

  • work on deleting the object from the persistent store.

    Hello

    I use permanent storage to store custom objects, I am able to save, retrieve, and update object. I'm ranger object persistent using State figure "obj" below.here is my custom object that implements Persistable interafce.

    PersistentObject store = PersistentStore.getPersistentObject (0xa1a569278238dad2L);

    store.setContents (obj);

    Store.Commit ();

    But, when I'm trying to delete 'obj' to permanent storage, I found it is ignored, I use possible subsequently remove the object

    permanent storage.

    PersistentStore.destroyPersistentObject (0xa1a569278238dad2L);

    but when I try to get again in my code by using the following statement

    MyObject obj = store.getContents ();

    I get all the properties of 'obj', is there a programmatic way to destroy the object of permanent storage? or is it expected behavior?

    Make sure that you not only remove the store, but also get the new PersistentObject object thus:

    PersistentStore.destroyPersistentObject (key);

    PersistentObject persistObj = PersistentStore.getPersistentObject (key);

    Object myObject = persistObj.getContents ();

    If this does not work then you might have some problems with synchronization - remove any synchronization around this code and check again.

    See you soon

    Nik

  • Persistent data and uninstall an app problem.

    Hello

    I'm checking the storage of persistent data with a very silly application, but maybe I'm do sth wrong as that it does not work as I supposed it should.

    My application only checks if there is some content in the store persistent and if not, it creates. I want to check that when the application is uninstalled, these persistent info will be deleted, but as I just test, it is not.

    This is my code:

     public TestP(){
            String info = "nothing";
            synchronized(store) {
                String currentinfo = (String)store.getContents();
                if(currentinfo == null) {
                    //we create it
                    String contents = "something";
                    store.setContents(contents);
                    store.commit();
                } else {
                    //we retrieve it
                    info = currentinfo;
                }
            }
    
            MainScreen ms = new MainScreen();
            ms.add(new LabelField("Testing Persistance..."));
            ms.add(new LabelField(info));
            ms.add(new LabelField("That's all..."));
    
            pushScreen(ms);
        }
    

    And that's how I create the store

    'com.app.test.TestP' at long---> 0xcdbcc77c2e7ecf8cL
    Bank private static PersistentObject = PersistentStore.getPersistentObject (0xcdbcc77c2e7ecf8cL);

    The first time I run my application, the display will return to "nothing" and the text next time 'something '. It's ok, but when I uninstall my application, the first time also shows 'something', which according to me, that he should not be allowed.

    I do something wrong?

    How persistent store information can be removed on an uninstall of the application?

    Concerning

    Your persistent data are of type String, which is a common object of the rim.  It is not necessary for the BB to delete your data - another application can use it.

    However, if you used one of your own classes - even if it comes extends the string and does nothing else - then it will be deleted when your Application is removed, because with your driveway application, there's nothing on the device which includes that Object.

  • Persistent objects

    I know there is a problem with the definition of an object persistent in a library if two or more applications will use.

    But he is sure to have an object in a library that other applications it will be extended to an object persistent more complex?

    Which always causes an error with the persistent store?

    Sorry, I have contributed to some discussions and I do not remember that you speak...

    It was probably two applications, eager to share an object.  And the point that if they share an object, they must also share the full qualified class, which means that have to share a library containing this class.

    In any case two different GUIDS should mean that you have no problem. However, the library should be deleted, both will go.

  • I repeat: open PDF OK statement tried to save statement witn my documents, PDF page deleted. wprks with Explorer - uninstalled FF, history/cookies delete

    Nearly 10 years with Mozilla FF. Why should I now make other changes to the PDF readers? It works with explore. I have reloaded Adobe (already installed), should I uninstall Adobe? but it works with other browsers.
    Delete the history was painful (I could have at least 5 years). After you uninstall FF 3 times, finally I use REVO
    On ly problem exist with the BANK STATEMENT (first opening OK then... blank. Should I blame the Bank? It opens with EXPLORE. Until yesterday, evrything was ok.
    Waiting for your help

    Thanks for your time
    

    Gerard

    Hi Gerard, you have moved away from using the PDF Viewer integrated into the Adobe Acrobat Viewer? This article has the steps to do this if you have not tried, and also shows where you can confirm who is used: How to disable the built-in PDF Viewer and use another Viewer.

    When you save a PDF file using the built-in Viewer, use the download button the toolbar above the PDF file (it looks like an arrow pointing down). This can be more reliable than the command save the Page under.

    When you save a PDF file using the Adobe Acrobat Viewer, when you move the pointer of the mouse down the document, a floating toolbar should appear with a drive icon. (Or if you press the ESC key, a toolbar should appear above the document.) Use the drive icon on the Adobe Acrobat toolbar to save the document.

  • The BlackBerry object Handles and the persistent object Handles?

    Can someone please what are the object Handles and handles of object persistent in Blackberry? and how are they different?

    Object handles are pointers to a Java object.  Each object that you create in your application using one of them.  Similarly, each object stored in the persistent store contains a handful.

    If you have a complex object you want to store in the persistent store, as a vector that contains a number of complex classes, you can store the vector in a group of objects that you want to save the object handles.  Grouped objects use a single Treaty when it is stored in the persistent store.  The disadvantage is to ungroup the object for editing.

    You will need to balance saving handles object against the drop in performance of separate objects.  Object groups are ideal for the complex elements that are frequently changed.

  • Delete the database during uninstall of the application

    Hello everyone, my requirement is to delte the database when we uninstall the application, I did a quick search in the forum, did not meet any results, hope that someone would be comup with an answer to my question.

    Help of any kind is welcome!

    A Y

    Hi avi_yach,

    The files are not deleted on uninstall.

    You can try and set up a CodeModuleListener or add an application which will remove your files once your original application has been uninstall.

    E.

  • Several persistent object

    Hi guys,.

    I am a new blackberry applications developer.  I am working on an app I need to store

    First of all:

    username (String)

    password (String)

    user (String) token

    Then I need to store travel information based on the user's token. Travel information contains a lot of vectors

    such as:

    Names of travel (Vector)

    Locator (vectors) travel

    ....

    I am able to stor channels without any problem in store it and retrieve it without any problem. I have problems storing vectors. This is my persistent class:

    class StoreUserInfo implements Persistable
    {
    private vector _elements;
    public static final int UserEmail = 0;
    public static final int UserPass = 1;
    public static final int UserToken = 2;
     
        Private vector _Trip_Locators; is it good?

    public StoreUserInfo()
    {
    _elements = new Vector (3);
    for (int i = 0; i)< _elements.capacity();="">
    {
    _elements. AddElement (new String(""));
    }
            
             _Trip_Locators = new Vector();  ////
    }
        
    public String getElement (int id)
    {
    Return (String) _elements.elementAt (id);
    }
        
    ' Public Sub setElement (int id, String value)
    {
    _elements.setElementAt (value, id);
    }
        
        public Vector getTripLocator()
    {
    Vector temp = new Vector();
    for (int j = 0; j)< _trip_locators.capacity();="">
    {
    temp.addElement (_Trip_Locators.elementAt (j));
    }
    Return (Vector) temp;
    }
        
        
    public void setTripLocator (String addValue)
    {
    _Trip_Locators.addElement (AddValue);
    }

       
     
    }

    Here's how to store information:


    synchronized (storeUser)
    {
    If (storeUser.getContents () is nothing)
    {
    storeUser.setContents (new Vector());
    storeUser.commit ();
    }
               
    UserInfoData = new Vector();
    UserInfoData = storeUser.getContents ((vector));
                        
    StoreUserInfo info = new StoreUserInfo();
    info.setElement (StoreUserInfo.UserEmail, UName);
    info.setElement (StoreUserInfo.UserPass, PWord);
    info.setElement (StoreUserInfo.UserToken, UserReceivedToken);
                        
    UserInfoData.addElement (info);
    storeUser.setContents (UserInfoData);
    storeUser.commit ();

    }

    and here's how to get the information stored:

    Synchronized (storeUserSaved)
    {
    If (storeUserSaved.getContents () is nothing)
    {
    storeUserSaved.setContents (new Vector());
    storeUserSaved.commit ();
    }
             
    SavedData = new Vector();
    SavedData = storeUserSaved.getContents ((vector));
             
             
    If (!.) SavedData.isEmpty ())
    {
    Info StoreUserInfo = (StoreUserInfo) SavedData.lastElement ();
    Political = info.getElement (StoreUserInfo.UserEmail);
    pass = info.getElement (StoreUserInfo.UserPass);
    sentUserToken = info.getElement (StoreUserInfo.UserToken);

    These work very well. However, I want to know how to store several objects (Vector) as unique user name.

    Could someone help me with this? I browsed the forum and I found similar posts, but still I can not solve this problem.

    Thanks in advance guys.

    Shan

    You can store a vector in the store persistent as long as all classes stored in the vector to implement the persistable interface.

    Can you elaborate on the problem that you are experiencing?  Is an error or an exception thrown?  If so, what is it?

  • AnyConnect client has persistent settings after uninstall

    Usually, I'm able to type in the address field of client anyconnect and change to another client (we are a partner that support many people).

    For some reason any has my client anyconnect 'infranet-cm0' and 'infranet-cups"(our call manager and presence servers) in the connection to the domain, and you cannot type in this area. It makes no sense at all... Need just the certificates on my system or something.

    I uninstalled the client several times and launched from web client I am trying to connect to - download the new client, but he always comes back to the top with these two options to connect. I have attached a screenshot.

    How can I get rid of these options and allow me to be still able to type in the address?

    Have you tried to delete the profile?

    Client deployment paths

    OPERATING SYSTEM
    The directory path

    Windows 7 and Vista

    C:\ProgramData\Cisco\Cisco AnyConnect secure mobility Client\Profile\

    Windows XP

    C:\Document and Settings\All Users\Application Data\Cisco\Cisco AnyConnect secure mobility Client\Profile

    Mac OS X and Linux

    / opt/cisco/anyconnect/profile /.

    http://www.Cisco.com/en/us/docs/security/vpn_client/AnyConnect/anyconnect31/Administration/Guide/ac02asaconfig.html#wp1595490

Maybe you are looking for