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

Web and WebWorks Development

Reply
Regular Contributor
Posts: 63
Registered: ‎10-06-2010
My Device: Not Specified

Exit and Database problem in the Web worker

Hi All

 

I have designed the application as hide and display a page, to avoid the reloading

I saw some code to exit the application as the blackberry.app.exit() in blackberry document.

the application get closed properly but the database used in that project is not released from the application.

for this i tryed to delete the database folder manually. it says "This is currently is in  use."

can any one know the reason for this.

the application is not in running state and the application is not in the background what was the problem?.

 

 

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Exit and Database problem in the Web worker

I think this is because the device software still has a lock on the DB.  It might release if you reset the device, or uninstall the app.  

 

Also, are you setting your DB object to null before you call blackberry.app.exit() or exiting the app?  I believe doing this may indirectly 'close' the DB (and help prevent a memory leak).

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Regular Contributor
Posts: 63
Registered: ‎10-06-2010
My Device: Not Specified

Re: Exit and Database problem in the Web worker

I am making the DB object to null before blackberry.app.exit() or exiting the app

 

and I checked the some senarios where DB folder can be deleted.

1) Device restart,

2) After closing the application connectting it with the USB to System,

3) When ever the application crashes etc.

 

 

Note:

When I get the DOM 11 Exception at the Database operation, in normal cases it was not able to open once again,  but when I connect the Torch 9800 with the sytem using USB then i opened the application it automatically created the new database in the SDcard (I am not sure what was the reason for that)

 

Their is two way to exit my application.

one is by pressing the back button their i handled the back button, other way is by pressing the menu button and select the close option- since it was not control of code, their i am not making the DB object is null;

 

for the both the cases the application does not release the Database, I think because of this the Database open count get increased and file read/write problem may come. 

 

that was causing the most of the application with database they are getting the DOM exception 11.