Problem with the persistent store & 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?

Tags: BlackBerry Developers

Similar Questions

  • What is the problem with the conversion of objects with gradients to the gradient mesh?

    What is the problem with the conversion of objects with gradients to the gradient mesh?

    Radial gradients are special, and it could become difficult edit the gradient mesh resulting.

    Take the layer apnel and inspect your objects. You will find a clipping mask the cracks inside.

  • What is the problem with the virtual store for Journ.E

    What is with the virtual store?
    I have a screen wihte, I never see virtual store?
    I think the support is very very bad.

    No one becomes an answer on the question!

    I put t know why Toshiba need so much time to solve this problem.
    Unfortunately, we have to wait until it will be fixed. :(

  • problem with the windows store 8

    Whenever I try to open the app store on my windows laptop 8 just on the loading screen. I waited for over 30 minutes and it has not yet opened. What should I do to fix this?

    Hello

    I suggest you to sign in with a different account from Microsoft and see if that makes the differences in the situation. If the problem persists, try to create a new user account.

    Hope this helps, good luck :)

  • Problem with the virtual store to Windows 7 basic, home

    Hello, I have a problem with Windows 7 64-bit home basic e-store. What happened is that I have a program that I use to make small electronic circuits and it was working fine until a few days when I noticed that the design I was doing seemed to be locked - I can open it but I can't open the second tab of the main window, which I should be able to do. After much research I discovered that the problem was caused by the virtual store of Windows - system registers my designs. I need to disable this feature because it prevents me from doing my work. I tried many things including turning off virtual store in REGEDIT and it doesn't change anything. I have another computer with Windows 7 starter and I have no problem there at all. I searched the internet for ideas and found two to this site http://www.askvg.com/how-to-tweak-user-account-control-uac-options-in-windows-vista-home-basic-home-premium/

    In all no joy. Help, please. I would appreciate only the answers that have been tried and tested not something that is supposed to work.

    Thank you, Ed

    (Moved from Windows |) Windows 7 | Performance and Maintenance)

    I have a program that I use to make small electronic circuits and it was working fine until a few days ago.

    Given that things worked fine until a few days ago I would use system restore to set Windows back a week.

  • I have a problem with the Windows Store updates.

    All of a sudden the app store came with updates for 4 items, the observer of the team, finance, travel and news. First of all, I don't have to install outside the viewer of the team.  So I install all updates of four, and then uninstalled, finance, travel and news. Then they cam right back up as updates in the store windows again. Windows store needs an update.

    There is not need to troubleshoot... this question is server-side, no amount of troubleshooting/patches help right now, see the thread I posted above and read it

    In addition, Windows Update has nothing to do with the update of the modern applications, they do not automatically install it, this will change in Windows8.1 (apps will be able to update automatically)

  • Problems with the data store when installting ESXi USB

    I had problems getting free ESXi reliable running.  I am able to install a flash drive fine and initially everything works and I am able to create virtual machines.  Upon the first connection to vSphere, told me that there is no data store, so I create one on my controller LSI 400 GB RAID1 8308elp without problem.  However, once I reboot the server ESXi I lose the data store.  When I check my warehouses under Configuration it is listed.  At this point, if I try to create the data store, yet once I get "Error during the configuration of the host".  I read about using fdisk from the console when people have had this problem but there is no access console in the free version.  Is that what I can do to work around this problem?

    Right in the HCL... SAS/SATA-RAID of the lists for older versions, SCSI for the current version... Search within i/o devices for "LSI 8308elp '...

    VMware VCP4

    Review the allocation of points for "useful" or "right" answers.

  • There is a communication problem with the iTunes store

    Apple TV 3rd generation, software to update... Am able to stream my netflix watch, but I'm having issues playing a show via iTunes, yes one alone. I can play all the others. What does that mean?

    Thank you!!

    See if a reboot of your Apple TV helps.

    Go to settings > general > restart.

  • Hello I am a student and I have a problem with the tool Selection (V). When I opened the file AI CC with CS6 selection tool doesn't allow me to change the selection. What can I do? (I have reinstall AI CC and the problem persists)

    Hello I am a student and I have a problem with the tool Selection (V). When I opened the file AI CC with CS6 selection tool doesn't allow me to change the selection. What can I do? (I have reinstall AI CC and the problem persists)

    Ivan,

    If it's on the rectangular objects, you may have encountered the bug Rectangle Live which is limited to the MAC versions from 10.7 and 10.8, but not of 10.9 (Mavericks) or 10.10 (Yosemite). If all goes well, the bug will be fixed soon.

    Thus, a switch for the Mavericks or Yosemite with a reinstall might be the way to solve it here and now.

    To get around it, in each case, it is possible to develop direct Rectangles to get the normal old shaped rectangles or Pathfinder > unit, or use the scale tool or the free transform tool.

    A more permanent way round that is to create normal old shaped rectangles, after running the free script created by Pawel, see this thread with download link:

    https://forums.Adobe.com/thread/1587587

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

  • Remote control/software Apple TV with the App Store problems

    Seems ridiculous that a Sept 2016 4th Gen apple TV purchase has the same problems of connectivity with the App store. Impossible to connect, or even choose App store, or spare parts offline, erratic, glitch and acts as a problem of distance, but seems to be a software problem or interface. Obvious corrections or ideas to stabilize or least to increase connectivity to app store with 4th Gen Apple TV/remote control?

    No problem of connectivity with a 4th getting Apple TV remote here... Sorry, you encounter this problem with it.

    See if there is something that will help that you haven't tried in this article to support > set up the Apple TV Remote - Apple supported application

  • Hello there is a problem with the iphone 6 and you do not want to connect to the Apple Store

    Hello there is a problem with the iphone 6 in more you won't connect to the Apple Store.

    Buenas tardes,

    Try a forced reboot. Hold down the home and Sleep/Wake buttons simultaneously for about 15-20 seconds , until the Apple logo appears. Ignore the "Slide to power off" text if it rises. You won't lose anything.

    Then sign out of the iTunes Store and reconnect.

  • launch of checkers problems: error: trying to re-launch your game. If the problem persists, it may be network with the server problems or a problem with the configuration of your firewall.

    Windows Vista can not launch problem of checkers: try to re-launch your game. If the problem persists, it may be network with the server problems or a problem with the configuration of your firewall. Please check your firewall settings by visiting the Open Ports FAQ.

    Original title: launch of the problems of checkers:

    Hello

    If you have not yet tried to disable the antivirus/firewall software, then try the following steps to disable them.

    Disable the anti-virus software: http://windows.microsoft.com/en-US/windows-vista/Disable-antivirus-software

    Enable or disable Windows Firewall: http://windows.microsoft.com/en-US/windows-vista/Turn-Windows-Firewall-on-or-off

    IMPORTANT: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks

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

  • Windows store error "we could not connect to the Bank. This can occur because of a problem with the server or the connection may have expired. Please wait a few minutes and try again. »

    Original title: Windows 8 store does not.

    Whenever I try to open the windows store, I get the message: "we could not connect to the Bank. This can occur because of a problem with the server or the connection may have expired. Please wait a few minutes and try again. »

    This happens constantly, and because of that I have not been able to upgrade to Windows 8.1.

    Hello

    This behavior can occur if the antivirus application blocking the app Store or changes due to some recent on the computer.

    I would suggest trying the following steps and check if it helps.

    Method 1:

    Make sure that your PC is up to date

    Make sure that updates are installed on your PC and that your antivirus program does not prevent the application from running. For more information about installing updates for your PC, see Windows Update: frequently asked questions.

    Method 2:

    Run 'Windows Apps Store' convenience store

    You must be logged in as an administrator in order to run the "Windows Store Apps" troubleshooter. This tool can automatically find and fix some issues with applications. It is available in English only, but will work in all languages. You can let automatically try to fix any problems found, or select what you want made repairs.

    http://download.Microsoft.com/download/F/2/4/F24D0C03-4181-4E5B-A23B-5C3A6B5974E3/apps.diagcab

    Method 3:

    I suggest you delete the Windows Store cache and check how it works.

    1. Press Windows + R logo
    2. Type wsreset.exe in the run window, and then press ENTER.

    Method 4:

    Define the Apps approved in third program Antivirus- If you have a third party AV program installed, check its settings to make sure that the app Store works is not changed to be approved. If the AV program has the app as unreliable, it will block and prevent opening the app.

    Let us know the status of the issue. If you need help, please after return. We will be happy to help you.

Maybe you are looking for

  • Credit card information removed from iTunes

    My credit card information are suddenly disappeared from my iTunes account.  This was not allowed - why and how did this happen?

  • Use getchannels to switch different channelgroup channel

    I'm moving all my channels flow in Group 4.  they are currently spread across several channelgroups. Dim oMyChn Dim oMyChannels Set oMyChannels = Data.GetChannels("*FLOW*") For each oMyChn in oMyChannels CallMsgBoxDisp (oMyChn.Name) CallData.Move (da

  • Ac130ds: Ac130dd

    Helping whenever I click on some of the letters on my keyboard like space l I or u is my screen then turns on the narrator and try me to sign new locks

  • 50% of the FILES in Windows Live Hotmail missing

    A lot of problems since the last 'upgrade '. Now [26 August 2010] when I signed into Hotmail all my Windows Live Hotmail all FOLDERS above the letter M (it's like the first half of the alphabet has been cut) have disappeared.  Have tried other soluti

  • bar - descriptor.xml: which category for app use?

    Hi @all, I'm developing an application of battery. In the file of the bar - descriptor.xml I choose as single category 'media' and 'games '. Do I have to select 'Media' or let him no classified? Thank you very much! Peter