Welcome!

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

Reply
Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

how to delete table in persistance and check memory after deleting

 

 

Hi,

 

                    i am using the persistence database to store the information by doing the following :

        

   static  PersistentObject store;
   static long LoginTableName  = 0x13356927822342382L;
   Vector vect = new Vector();
   store = PersistentStore.getPersistentObject(LoginTableName);
   vect.addElement(loginInfo);
   store.setContents(vect); 

 

 

                 And to retirive the data from persistence database i am doing the following :

 

 

         store = PersistentStore.getPersistentObject(LoginTableName);
         loginObj=(Login)store.getContents();

 

 

Now my problem is i want know how do i delete the data in persistence data base that is how delete the  table "LoginTableName". And after deleting the table is the memory free ed then if memory is free ed then  i also want to know the total memory after deleting the table.

 

 

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how to delete table in persistance and check memory after deleting

setContents(null) and commit.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: how to delete table in persistance and check memory after deleting

Hello,

             thank u for reply,

            well will the table get deleted is i set it to null

           Now after setting it to null i want to check the memory is the memory is free ed up how to check it in the program kindly help

Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: how to delete table in persistance and check memory after deleting

kindly anyone help

Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: how to delete table in persistance and check memory after deleting

pls give some idea

Developer
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: how to delete table in persistance and check memory after deleting

[ Edited ]

What, the long value you set? It's just a long, and should be static data. Don't worry about it.

 

If you're talking about the Vector, though, set the Vector to null as well and let the garbage collector take care of it.

Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: how to delete table in persistance and check memory after deleting

what about checking of memory i want to check the memory after making it null will the memory be allocated that will the free memory be available.... i want to check before making the table null/deleting and again i want to check after making the table null....i want to see the memory incresing.....

Developer
Posts: 212
Registered: ‎07-18-2008
My Device: Storm 9550

Re: how to delete table in persistance and check memory after deleting

check:

 

Memory.getPersistentStats().getFree()
Memory.getPersistentStats().getObjectCount() 
Memory.getPersistentStats().getAllocated()

If your problem was solved, please mark answer as "Accepted solution"
If your want to thank, click the "kudo" symbol
___________
visit me: http://mobilejavadevelopment.blogspot.com/
visit the Berlin BlackBerry Developer Group: http://berlinblackberrydevelopers.blogspot.com/