Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 35
Registered: ‎11-26-2008
My Device: 8100

how to clear or reset persistent store object

i am using JDE 4.7 with storm simulator


i am developing favourite app

i can add things to favourite list

but i can not delete from that list


first i create the persistent object with one specified ID

then i use setContent method to add into list

i am adding Vector type object


for deleting item from the list, i get contents from the persistent store object

then delete the particular item and rebuild the vector and then add it to store object


but this will not work as in store object, i have to clear previous contents

then can add newly rebuilded vector 


but i do not know how to reset or clear persistent object without changing it;s long hexadecimal ID


please help me

Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: how to clear or reset persistent store object

[ Edited ]

You can use "destroyPersistantObject" method of "PersistentStore". Use the same ID and create persitent object.



Message Edited by BBDeveloper on 01-16-2009 05:47 PM

Use Search. "Accept Solution" If the problem is resolved.
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: how to clear or reset persistent store object

[ Edited ]

What error did you get ?


If you use the same unid to store the object the previous object will be rewritten.


It is not necessary to delete the object.


Also I recommend to create a wrapper class that contains Vector and store/load this class.


Otherwise your persistent data will remain on device memory when your application uninstalled.

Message Edited by tbilisoft on 16-01-2009 12:36 PM