Issue in updating DB?

Feb 24, 2011 at 3:19 PM


A couple of months ago, I delivered an app with a previous db version. Now I've updated the db and some people are reporting errors in starting the app. Since the opendatabase() is one of the first operations done by the app, I'm suspecting that there could be a problem due to the db update? All classes I used have not parameterless constructor since I did not wrote constructors at all. This means there are no constructor with parameters and there are not parameterless constructors. Could this be a problem?

On my emulator I have no problems so I cannot understand wht is happening to those people complaining.....

please, help me!

Feb 24, 2011 at 3:27 PM

Did you test your upgrade on the actual phone by any chance?  What type of errors to your users see?  Did your classes change at all during the upgrade?  Did you add any new classes?  Do you use the same name for DB?

It is kind of hard to figure this out without a bit more information...


Feb 24, 2011 at 5:05 PM

first of all thanks for your fast answer...
here answers to your questions:
Did you test your upgrade on the actual phone by any chance? I still have not a phone (ok.. I know this is not the best... but the emulator always worked fine...)
What type of errors to your users see? They report me that the app just close (the typical behavior of an unhandled exception)
Did your classes change at all during the upgrade? no
Did you add any new classes? No
Do you use the same name for DB? Yes

any idea?

Feb 24, 2011 at 5:40 PM

I think the error is going to be pretty imnportant to troubleshoot the problem.  You might want to add try/catch around DB opening code (or wherever the users see the issue) and least display the message, ideally email it to you...

Assuming, your code checks for DB existance and only creates if it does not exist, you at should not have any issues with the upgrade.  If you want to post chunks of your code, I maybe be able to spot something. 

My advice would be to add try/catch and re-publish the update right away, while you are troubleshooting other issues.  Once that is done, try to contact one of your users and have them re-test and tell you waht errors they are getting.

Feb 26, 2011 at 4:21 PM


I've just realized that info I gave you were partially wrong. I added a new table in db... could this be important?

thanks for your patience and your support!

Feb 26, 2011 at 7:34 PM

Yep.  You need to add code to create the new table if it does not exist before you use it.  I believe this is the root cause of your issue.