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

Tags: BlackBerry Developers

Similar Questions

  • Editing an object that I stored in the persistent store

    I store a custom object in the store persistent and would like to add a new Member.  Someone knows how can I do this?  I'd rather not delete it and store an object in its place because what happens if I need to add more members in the future.  This would encourage me to juggle all versions of my object.  Is there a kind of model for version control that I can apply to my objects stored persistently?

    I don't think it will work.  The link that you say talk us too much serialization, but the persistent object is not serialized as part of persistence.  If you want to serialize her, you should do it yourself.

    I'm guessing that you did not design your class being "expandable". And I'm guessing that you do not want your users to have to recreate these data.

    So I investigate an approach to migration.  In the code that gets the persistent store, got it get the object persistent, then check that it is indeed a picture of your old items.  If it is, convert it to an object type, store it in a collection (vector or Hashtable as suggested, for example) and keep the result, by replacing your old array of persistent storage object.  So your new application includes the old class of objects, exactly as it was, which means that you can install it on top of your existing application.  But once your request is used at the same time, the old persistent object is no longer used.

    Does make sense?

  • Object named 'record' is not found in the persistent store

    When I access portlet, I got the following error on side producer portlet:
    Could someone help what they indicate:

    Thank you
    Root cause of ServletException.
    oracle.portlet.server.container.InvalidRegistrationException: oracle.portlet.server.containerimpl.ContainerObjectNotFoundException: Object named "registration" could not be found in the persistent store.
         at oracle.portlet.server.containerimpl.ConsumerRegistration.<init>(ConsumerRegistration.java:88)
         at oracle.portlet.server.containerimpl.ResourceServlet$ResourceRequestWrapper.<init>(ResourceServlet.java:138)
         at oracle.portlet.server.containerimpl.ResourceServlet.service(ResourceServlet.java:93)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.server.service.ContextFilter.doFilter(ContextFilter.java:101)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.bea.content.manager.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:178)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:230)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3593)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2203)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2109)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1427)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    oracle.portlet.server.containerimpl.ContainerObjectNotFoundException: Object named "registration" could not be found in the persistent store.
         at oracle.portlet.server.containerimpl.persistence.ConsumerPersistentStorage.get(ConsumerPersistentStorage.java:83)
         at oracle.portlet.server.containerimpl.ConsumerRegistration.<init>(ConsumerRegistration.java:69)
         at oracle.portlet.server.containerimpl.ResourceServlet$ResourceRequestWrapper.<init>(ResourceServlet.java:138)
         at oracle.portlet.server.containerimpl.ResourceServlet.service(ResourceServlet.java:93)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.server.service.ContextFilter.doFilter(ContextFilter.java:101)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.bea.content.manager.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:178)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:230)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3593)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2203)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2109)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1427)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    You try to migrate a portlet in JDev 10135 FOR PS1? If so, you can try to do the following:

    -Create a consumer with portlets of the server application embedded in 10.1.3.5
    -Open jdev PS1 and import the settings of the 10.1.3.5 system directory
    -Refresh record producer
    -Run the page again

    I hope this helps.

  • IT detect policy "allow third party applications to use the persistent store" by program

    Our application uses the persistent store widely, and we try to find a way to fail gracefully, with a coherent, when the it policy error "allow third-party Apps to use persistent store" is disabled.

    Ideally, we would detect this setting programmatically and displays an error to the user to inform them that this is the condition that prevents us from running.  It seems that the ITPolicy class in net.rim.device.api.itpolicy would allow us to do, but I can't understand what I asked for to verify this IT strategy value - I can't find documentation on most of the system properties how to query their status and try the guess of getBoolean ("AllowThirdPartyUsePersistentStore", true) does not appear to return the correct value.

    Or, if there is a better way to detect this State, that would work too.

    Thank you.

    Hello

    The settings to use in the class plan ITPolicy to the ITPolicyTemplate2 of the BlackBerry Enterprise Server BESMgmt database table.

    for the "allow third-party Apps to use store persistent' policy, which is a 24 tag and subtag of 17. However, please pay special attention to the it policy Description:

    This rule is obsolete. || Specify if third-party applications on the BlackBerry smartphone can use the RIM store persistent application programming interface (API). || Computers handhelds with OS version 3.x and below must use policy AllowThirdPartyUsePersistentStore IT. | The 4.0 and later versions must use application control policy. || If you do not set this rule, a default value of True will be used. || This rule applies only to the BlackBerry Java-based instruments version 3.6.0 by 4.0.0.

    A complete list of policies COMPUTER located in the reference of policy here: http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=6199802&sliceId=&dialog...

    Tariq

  • increase the size of an array stored in the persistent store

    Hello

    I have a question.  I use the persistent store to store the data.

    When there is a new medium, I need to add it in this table.

    The problem is the size of the table is fixed, how do I re - set the size of the array? and save the persistent store return?

    Thank you

    Yes, vector will be better because you can't copy items.

    If you use the simple table of data types would be more effective, I think, you can take a look at Arrays.fill, then.

    No referenced objects are captured by garbage collection.

  • Update the persistent store

    Hi all

    I am a soft developer for BB. I need a little clarification. Is it possible to update the data stored in the persistent store? Pls answer...

    Thank you in advance...

    Welcome on the support forums.

    If you commit something to the store, you replace the existing value. of course, you can read the existing value and change it before you engage again, or commit any other thing.

  • Problem with the persistent store &amp; object

    Hello

    I store 2 types of persistentObject in PersistentStore. I find the problem when retrieving the Typeobjet2. The code is:

        private void GetPersonFromPhone() {
            synchronized(store) {
                data = (Vector) store.getContents();
            }
            System.out.println("\\\\\\\\\\\\\\\\\\  Into GetPersonFromPhone Data = " + data.size());
            PersonInfo pi = null;
            Person p = null;
            for ( int i = 0; i < data.size(); i++) {
                System.out.println("Object Got i = " + i + " - " + data.elementAt(i).getClass().getName());
                if (data.elementAt(i).getClass().getName().endsWith("PersonInfo")) {
    
                      .....
                      data.removeElementAt(i);
                }
            }
             p = null;
            pi = null;
            return;
        }
    
        private void SavePersonsToPhone() {
            PersonInfo info;
            System.out.println(" To SAVE Persons = " + personVec.size() + " To Store Data Size = " + data.size());
            for (int i=0; i < personVec.size(); i++) {
                info = new PersonInfo();
                data.addElement(info);
                p = null;
                info = null;
            }
            System.out.println("Now DATA size = " + data.size());
            synchronized(store) {
                store.setContents(data);
                store.commit();
            }
           // Dialog.inform("Success Stored");
    
            info = null;
            return;
        }
    
     Results
    

    Nobody GOT = name = Mr John Micheal, Email =, URL = store/samples/pictures/Quiver_Tree.png, Send = true
    Size PersonVector = 1
    Object obtained I = 3 - src.se.PersonInfo
    Nobody GOT = name = Peter Simon, email = [email protected], URL = store/home/user/iBeloved/photo1, Send = true
    Size PersonVector = 2
    GOT people = 2 size = 3 data store

    Add new record

    Person - McMillan Desilva, [email protected] , SentEmail = false

    To SAVE the people = 3 to the data store size = 3
    Save I have 0 - name = Mr. Micheal John = Email, URL = store/samples/pictures/Quiver_Tree.png, Send = true
    Added Mr. John Micheal, Email = true to vector to the store
    I save 1 - name = Peter Simon, email = [email protected], URL = store/home/user/iBeloved/photo1, Send = true
    Peter [email protected], Email added = true to vector to the store
    Save I have 2 - name = McMillan Desilva, Email = [email protected], URL =, Send = false
    Added McMillan detailed [email protected], email = false to Vector to the store

    The NEXT TIME that I RAN the APPLICATION

    Nobody GOT = name = Peter Simon, email = [email protected], URL = store/samples/pictures/Cascade.png, Send = true
    Size PersonVector = 1
    Object obtained I = 3 - src.se.PersonInfo
    Nobody GOT = name = Peter Simon, email = [email protected], URL = store/home/user/iBeloved/photo1, Send = true
    Size PersonVector = 2
    GOT people = 2 size = 4 data store

    To SAVE the people = 2 to the size of the data store = 4
    Save I 0 - name = Peter Simon, email = [email protected], URL = store/samples/pictures/Cascade.png, Send = true
    Peter [email protected], Email added = true to vector to the store
    I save 1 - name = Peter Simon, email = [email protected], URL = store/home/user/iBeloved/photo1, Send = true
    Peter [email protected], Email added = true to vector to the store
    DATA size now = 6

    You CAN SEE FROM THE results, how the data changes and incompatibilities. Sometimes he gives good resutls sometimes incompatibilities. Someone can say, where I'm going wrong or what makes the results of the get code.

    Thank you

    Not looked at seriously, but there seems to be a coding bug in this piece of code:

    for (int i = 0; i)< data.size();="" i++)="">
    System.out.println ("object got I I =" + i + "-" + data.elementAt (i) .getClass () .getName ());
    If (data.elementAt (i) .getClass () .getName () .endsWith ("PersonInfo")) {}
    ....
    data.removeElementAt (i);
    }
    }

    Say that the vector has 3 elements inside.  You spend the first at the beginning of the second loop, I = 1, and the for loop see data.size () 3.  Then you deal with the second and delete.  Then when you go back to the loop for I = 2, and data.size () = 2, so you never treat a third.

    Of course, logic could just as easily result in code by jumping the elements of the vector.

    Maybe that's your problem?

  • I want my standard account work and delete the Admin account.

    When I got to the computer a portable windows 7 I did the daughter of a user name maxewell my keyboard got wet and I had it repaired my password was Danielle livick when I got my laptop back I added Danielle 28 and it of a standard user and deleted maxewell daughter well, in the search bar it shows up , but not in the control panel to remove it, so I don't know why it's there and how to remove and also I made an account administer Danielle 29 and every time I do something on my computer a thing with Danielle 29 and he asks me a password then when I did the admin account , I didn't put a password I tried to remove it and it won't let me all I want my standard account 28 Danielle and delete the admin account, but I can't help me please

    Original title: Hi I have a windows 7

    You must be at least one account Admin on the PC.  It's just the way that Windows 7 works.

    The account that you used to make the new Admin account must also be an administrator full - account only administrators can make new accounts.

    Of running Windows 7, it is recommended to use a user account Standard for all daily activities.  In addition to that, make two password protected administrator accounts & write passwords.  Make a password reset disk for each account on the PC.

    On the removal of Maxewell girl - the account is deleted [this is possible by an Admin]

    1. go to the daughter of C:\Users\Maxewell's and copy all the files of this user that you want to continue

    2 using Control Panel, user accounts, manage another account.

    3 you can then remove the entire Panel Contorl system, advanced system, Advanced tab settings user profile, select user account profiles - settings button - then click on the button Delete

    4. go on girl C:\Users\Maxewell's and verify that the files are deleted

  • Filters stopped working after deleting the .msf files

    Thunderbird has become slow and unresponsive so I used a tool to correct the problem, thunderfix.
    (probably it was preferable to delete the files manually, as in almost every case XD)

    Mailboxes are smooth now, however, the filter not covered more.
    When loading, Thunderbird advise me to repair the permissions/folder.
    I tried to add the 'control' my user permissions windows (folder)
    Where is option fix in thunderbird?
    Finally, I'll also have a backup profile, if the operation is impossible.

    Solved. (I'll close it).
    I met the problem once again, but I took the 'magical' moz backup to restore. Please do not use Thunderfix and do it on the manual way: on win10, with administrative rights, also has problems with filters as mentioned above.

  • Migration of virtual machines from a data store, and then delete the data store?

    Hello

    I have a future deployment this month and my Director wants to build a new RAID 6 array, create a store of data with the new table and then move all the VMS to the newly created data store.

    Then he asked me to take the old data store and remove it and the available space between the deleted data store and other stores of data in our shared environment. The question is when the new raid is created and vm has migrated to the new data store, which is the best way to remove the data store empty and make sure that the space available for other data stores? Any help would be appreciated...

    Greg ~.

    If all controls are met, you can go ahead and take it apart without any problem.

    I have re-iterate below checks:

    -No virtual machine is in the data store

    -The data store is not part of the cluster data store

    -The data store is not managed by the DRS storage

    -IGCS is disabled for this data store

    -The data store is not used for vSphere HA heartbeat.

    Especially highlighted 2 controls. Please note that SIOC can be enabled on the data without SDR photo store

  • How does the synchronization, the persistent store

    I have number of persistent store for the storage of data, etc.

    When I handle a store (addition, deletion or update), should I need to block the manipulation on another store?

    as there is no reviews for the class being thread-safe, I suggest that you synchronize access yourself.

  • Try to delete the data store: error DestroyVmfsDatastore

    Hi all

    I am trying to remove a data store (storage is iSCSI). There is no VM on the data store.

    In v2.5, I must click on remove datastore, she thinks for a few minutes and then remove the data of all servers store.

    In version 4.0, I clicked on delete, and it has only removed from a host. Instead of be connected to 8 hosts than before it was presented as connected to 7 guests.  (it should not be connected to all guests!).

    If I try to remove it from another host, I get an error message:

    "Error while configuring the host: DestroyVmfsDatastore: can't delete partition 1 on lun vmhba32:12:0 '.

    I tried this on two stores different data I needed to delete with identical results. Any ideas?

    Instead of be connected to 8 hosts than before it was presented as connected to 7 guests.

    Have you tried to force a rescan storage adapters?

    André

    * If you found this device or any other answer useful please consider awarding points for correct or helpful answers

  • Deleting an object from an environment

    Hi all need help. Creating a Board of digital trends for my homework. Need to cut and display elements ahead of trends. When I try to delete, for example, a sofa of his environment it works but then I try and hover over to Microsoft works and white background returns. How can I keep it so that the image of the only couch invades and not the bottom!

    Help it drives me crazy

    Stephanie

    Hi Stephanie

    I'm no expert, but if I understand your question I cut out the couch of his background and save it as a transparent file (PNG).

    Hope that helps.

    John.

  • "Order by" in the persistent store

    Hello

    I want to sort the records to permanent storage, by putting in place a query as

    "Select TimeStamp in the Table where ID = + someID order by Date desc limit 0,1 '.

    How can I order documents in the store and pick up the most recent date?

    Help, please

    Take a look around the available sorting collections - for example SimpleSortingVector.

  • 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

Maybe you are looking for

  • When implementing t/bird I accidentally did TICK "remember this password" How can I reset that password required?

    What happens then when I open t/bird my email open without needing a password. I want to change it back and can't find where to do that

  • There is no part (PSAAKL) number satellite A100 - 1401E

    I use the Satellite A100 - 1401E with part number PSAAKL - 00 002 M running Vista Home Basic. I installed windows XPsp2, I can't find the proper drivers, because PSAAKL - 00M 002 part number is not available in the list of model/partnumer. Is there s

  • 7520 HP e-all in one printer

    I can't get my failure to be "plain paper".  Under the properties...paper/quality... I was on "main tray", "8 x 10"and the paper remains at the HP Advanced Photo paper... and I can't get the default to return to the "plain paper". "   As part of phot

  • The user's Active Directory domain

    In the Console of BB10, under Microsoft Active Directory integration, you can change the "domain of the user.  I need to be able to change this setting through the API.  Is there a function for it?  Currently, the admins have manually change this set

  • NetPro lose messages in discussions

    Hi all It seems to me that on the night of January 16 to January 17 (good, somewhere between 16 January 20:00 and 17 Jan 09:00 THIS) some positions on NetPro disappeared. That night, I made a reply in the thread about WFQ: https://supportforums.Cisco