Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
08-31-2011 10:39 AM
I am curious about if two persistence store hold same object, what will happen and what is memory allocated?
Store A object handle -------- Object content --------- object handle Store B.
if changing Object from Store A handle and save it, I believe it will effect B.
what is pros / cons?
08-31-2011 10:48 AM
08-31-2011 07:35 PM
OK, well I have a slightly different model on PersistentStore from Simon.
Firstly the difference is does the BB actually Serialize the Object. I don't think it does. I think it stores the Object in its internal Object form. And I think you can actually reference this Object. Until you change it, it will remain in the Persisted memory.
The follow-on form this is what happens when an Object is referenced twice. There are two cases.
First the simple case.
I have a Vector, in element 0 and element 1, I have a reference to an Object - the same Object. I persist that Vector. When I restart my device and get back my Vector will I still have element 0 and element 1 referencing the same Object. I think so.
Now the more complicated case.
Say I have two Vectors, Both have in Element 0, a reference to the same Object. I persist both Vectors, but I persist them in different 'IDs' Then I retrieve both. So I have two different Vectors, but do both have the same Object in element 0. I think they do.
This would be easy to test. But unfortunately I'm not going to find time in the immediate future, but if some one else could test, that would be fantastic. Thanks
And I should point out when designing data that is going to be persisted,I recommend that you make sure there are no cross references, so this sort of problem does not worry you. One way is to 'normalize' the Objects, so that if Object A references Object B, it will actually have an id for Object B, not a reference for Object B.
09-01-2011 04:52 AM
09-01-2011 04:11 PM
Thanks you guys kind post.
I keep my words to test in future. my project is whipping my A... right now.
I will do test which peter mentioned in thread and let you know the result.