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
Trusted Contributor
Posts: 119
Registered: ‎11-28-2011
My Device: 9930
My Carrier: Verizon

Loading Large Tables into SQLite

I am creating and loading 6 sizable tables (largest about 2,000 rows) into a SQLite database when my program starts using several javascript files, one for each table.

When I do this on a physical device ( 0330 Curve OS6) the application locks up on startup. I think this is because the database is not being built succesfully. Has anyone encountered a problem like this?

Highlighted
Trusted Contributor
Posts: 119
Registered: ‎11-28-2011
My Device: 9930
My Carrier: Verizon

Re: Loading Large Tables into SQLite

Gave up on getting the full database to load for the 9330. Created a smaller database and changed the app so that it ran more limited queries. Plan to deploy this modified app to ow powered devices and keep the full database and original app for higher powered devices that don't seem to have a problem (1Ghz +).

Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: all
My Carrier: none

Re: Loading Large Tables into SQLite

Just curious - do you know the size limit for SQLite when using Web SQL? I also have strange problems with Curve 9330 that I don't have when using emulators. I noticed that when using smaller chunks of INSERT helps, but it is still erratic.

 

Thanks,

 

Sam

Trusted Contributor
Posts: 119
Registered: ‎11-28-2011
My Device: 9930
My Carrier: Verizon

Re: Loading Large Tables into SQLite

I don't believe there is a real limit to the size of sqlite tables based on the documentation I've seen.

http://www.sqlite.org/limits.html

"Maximum Number Of Rows In A Table

The theoretical maximum number of rows in a table is 264 (18446744073709551616 or about 1.8e+19). This limit is unreachable since the maximum database size of 14 terabytes will be reached first. A 14 terabytes database can hold no more than approximately 1e+13 rows, and then only if there are no indices and if each row contains very little data."

 

I think the limitations have more to do with the hardware of the device you are trying to use.

The largest tables I was trying to load on my 9330 curve were around 20K rows. 

On Blackberries with more robust hardware than this curve model, I haven't had a problem.

Certainly not on any of the more recent OS7 devices.

 

Trusted Contributor
Posts: 119
Registered: ‎11-28-2011
My Device: 9930
My Carrier: Verizon

Re: Loading Large Tables into SQLite

The curve just never seemed to crunch through all my tables fast enough to deliver a good user experience, if it managed to get through all of them at all. I gave up.

Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: all
My Carrier: none

Re: Loading Large Tables into SQLite

Thanks.

I am aware of the SQLite technical details. However, in Web environment sometimes there limits set by browser manufecturers (iOS has 50 MB size limit for all database for a single origin). I could not find any info for the BB, though.

Trusted Contributor
Posts: 119
Registered: ‎11-28-2011
My Device: 9930
My Carrier: Verizon

Re: Loading Large Tables into SQLite

I believe it is about 5MB.

How big are your tables?

Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: all
My Carrier: none

Re: Loading Large Tables into SQLite

They could be quite large > 60 MB. I was ables since to load about 80MB on a Curve - does not seem like it is complaining...

Trusted Contributor
Posts: 119
Registered: ‎11-28-2011
My Device: 9930
My Carrier: Verizon

Re: Loading Large Tables into SQLite

Then you've done more than I was aboe to do...

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

Re: Loading Large Tables into SQLite

The BlackBerry Web engine should be enforcing a 5Mb limit per domain for WebDB meaning you could get 60+ Mb of data stored for your application if it is leveraging multiple domains.  For WebWorks applications, the 5Mb limit should be per application.  As it was mentioned earlier in this thread, this is part of the Web standard.

 

If you are seeing otherwise it could be a non-compliance bug?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.