05-25-2010 10:09 AM
Hi,
I am storing a vector in the persistant storage .when i am using removAllelement() method of vector to remove all the element from vector this removes data from the persistant storage.why device is behaving like this.I am using blackberry 8900 OS 4.6.1.
Solved! Go to Solution.
05-25-2010 10:47 AM
the object stored is the same your are currently handling. if another application performs a commit on a persistant stores ALL stores are persisted and your empty vector is written into the persistant store, even without you committing it.
you can copy the stored vector if you want to modify it without altering the stored one.
05-26-2010 01:59 AM
I am not doing any commit operation after removing all the elements from vector.In my case why this is happening.
05-26-2010 03:52 AM
Hi,
It's strange behavior. I do removeAll() a lots without this side effect.
I know another reason why persistent store can be cleared - if you store your own classes and do uninstall application before new installation.
To check all commits you can also try next trick - write wrapper for persistent object and call commit of wrapper instead of PO. Log this event or check in debug. After that you will be 100% sure that commit isn't called.
Thanks,
Eugen
05-26-2010 04:13 AM
as MSohm said in another post it is sufficient for another application, even a system app, calling commit on ANY persistant store to commit all pending changes. if you want temporary modifications work on a copy.