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

Native Development

Reply
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

SQL is buggy in Cascades

I am running the "Quotes" Cascades sample app, and it works fine in the simulator. But when I try to run it on a real device it appears as if all writes to the database fail.

 

Is this a known bug? or am I doing something wrong with packaging the app for release?


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: SQL is buggy in Cascades

I hadn't used the simulator yet, but observed the same thing on the Dev Alpha. Since it was my only sample from which to draw conclusions, I simply assumed (didn't even check) that the code didn't even implement any persistence features.

Sounds like a bug in the device build of the OS then...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 41
Registered: ‎04-27-2010
My Device: Z10
My Carrier: VIettel

Re: SQL is buggy in Cascades

I have no issue with Quotes sample running on Dev Alpha.

 

Could you provide more detail about the issue? Such as at which part it works and when it doesn't work.

 

Cheers.

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: SQL is buggy in Cascades

It appears to fail whenever I have to make a write to the database.

 

For example if I try to add a new quote, when I hit save the screen exits and brings me back to the app's main screen with no trace of the newly added quote to be found.

 

If I try to delete a quote, nothing at all happens.

 

If I edit a quote, the changes do take. But then once I exit and re-launch the application, then they are no longer, anywhere to be seen.


Read my thoughts on BlackBerry Development at news.ebscer.com
Contributor
Posts: 41
Registered: ‎04-27-2010
My Device: Z10
My Carrier: VIettel

Re: SQL is buggy in Cascades

Hmmm... It's pretty general, did you try to debug it?

 

I suggest you looking at the Console to see if there is any error while running it on Dev Alpha.

 

Also try to manually debug using qWarning() to check if things go right. have you modified the C++ code of it? For me it works at the first time without changing any code.

 

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: SQL is buggy in Cascades

I have not modified a line of code.

 

No idea what is going on...


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: SQL is buggy in Cascades

Ebscer, are you "debugging" or "running" it? And in development mode (i.e. using a debug token) or signed?

I was running a signed/release copy, and that one didn't and still doesn't work.

I tried running a development mode version (debug token, but not "debugging") and it works... persists my changes, retrieves them upon restart.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 41
Registered: ‎04-27-2010
My Device: Z10
My Carrier: VIettel

Re: SQL is buggy in Cascades

As peter9477 said, I also got it running in Development Mode with Debug Token, but for the signed one, I did modified the code and it also worked.

Thus I suggest you guys put the database file into different location, the safe one could be "shared/documents/quotes.db" in stead of app asset folder and change the path in C++ code.

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: SQL is buggy in Cascades

[ Edited ]

I have the code signed on the device. (Which could explain why the simulator acts differently).

 

I will try moving the database location and see if that helps at all.

 

Update: giving the database a different location did not seem to help. (although there is some chance I did that wrong as well).


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: SQL is buggy in Cascades

Okay, wow... little known fact.  In fact, so little known that I don't know if any of us "out here" know this.

 

When you install a devmode (debug token) install, the app/ folder contents are actually writeable by user "apps" and by the "devN" group (N is a number from 0 to 99) under which your app is installed.

 

The quotes database for this sample is not copied to the sandbox data folder, nor to shared. It's just left in the app folder, with the code and assets.

 

With a signed install, that entire tree (under app/) is read-only. Everyone knows that... or should.

 

With a debug token install, the tree is writable. Who knew that?

 

This probably explains a bunch of the problems certain people have had in this and other forums, where they say "It worked when I tested it, but the signed version won't work."  Chances are their design is flawed, because they didn't actually know their app/ tree is supposed to be frozen and will be unwritable in the release build.

 

Anyway, that explains this particular thread. SQL isn't buggy... the sample is, or at least it's a dangerously simplistic sample since no real app can do it this way. (They would have to copy the quotes.db from the app folder to the data folder at first launch, and then always work there.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!