Hi, I'm trying to trace down a database upgrade bug and need to figure out a way of simulating market upgrades. Currently what I'm doing is: $ adb install -r MyApplication_versionX.apk My database upgrade is pretty straightforward (delete all the tables then re-create them) though for some reason I'm getting a bunch of bugs from users where the new columns are missing. Has anyone else had a similar issue? Is it hardware specific or could something else be causing it? Thanks a bunch in advance. -- CS
On 11/24/2010 11:22 AM, Christopher Saunders wrote: > Hi, > > I'm trying to trace down a database upgrade bug and need to figure out a > way of simulating market upgrades. > > Currently what I'm doing is: > > $ adb install -r MyApplication_versionX.apk > > My database upgrade is pretty straightforward (delete all the tables > then re-create them) though for some reason I'm getting a bunch of bugs > from users where the new columns are missing. > > Has anyone else had a similar issue? Is it hardware specific or could > something else be causing it? > > Thanks a bunch in advance. > I've done this quite a bit, haven't come across any specific issues. That's currently how I test it, as I think it gives the best chance of preventing any database corruption. Definitley a pain, as it requires more testing than normal. If you're not saving any data, an easier way might be to check the db version in the extends application file. and just delete the database if it's an old version. The app would then just recreate the database when it's opened. Something like, DB = DBAdapter.open(this); if (DB.getVersion < x) { DB.close(); this.deleteDatabase ("mydb"); } jarred
Have you considered using an SQLiteOpenHelper to assist in creation / upgrading of your database? I find them very easy to manage upgrading database versions with. They handle the checking of db versions, and provide an excellent way to encapsulate your database logic (creation and upgrade) into a single class. On Wed, Nov 24, 2010 at 6:28 PM, Jarred Freeman <jarred@earthflare.com>wrote: > On 11/24/2010 11:22 AM, Christopher Saunders wrote: > > Hi, > > > > I'm trying to trace down a database upgrade bug and need to figure out a > > way of simulating market upgrades. > > > > Currently what I'm doing is: > > > > $ adb install -r MyApplication_versionX.apk > > > > My database upgrade is pretty straightforward (delete all the tables > > then re-create them) though for some reason I'm getting a bunch of bugs > > from users where the new columns are missing. > > > > Has anyone else had a similar issue? Is it hardware specific or could > > something else be causing it? > > > > Thanks a bunch in advance. > > > > I've done this quite a bit, haven't come across any specific issues. > That's currently how I test it, as I think it gives the best chance of > preventing any database corruption. > Definitley a pain, as it requires more testing than normal. > > If you're not saving any data, an easier way might be to check the db > version in the extends application file. and just delete the database > if it's an old version. The app would then just recreate the database > when it's opened. > Something like, > DB = DBAdapter.open(this); > if (DB.getVersion < x) { > DB.close(); > this.deleteDatabase ("mydb"); > } > > > > > > jarred > -- Brad
Oh yeah. I've been using them since day 1, which is why I'm really confused about the bug I have. I did a bunch of faux upgrades on 3 separate devices, and for each version update the SQLiteOpenHelper did it's job. Deletes everything then rebuilds the database. Though for some reason, a bunch of users have been logging bugs about the application not working, and when I look at their stack traces its about missing columns. On 10-11-25 9:03 AM, BradS4 wrote: > Have you considered using an SQLiteOpenHelper to assist in creation / > upgrading of your database? I find them very easy to manage upgrading > database versions with. They handle the checking of db versions, and > provide an excellent way to encapsulate your database logic (creation > and upgrade) into a single class. > > On Wed, Nov 24, 2010 at 6:28 PM, Jarred Freeman <jarred@earthflare.com > <mailto:jarred@earthflare.com>> wrote: > > On 11/24/2010 11:22 AM, Christopher Saunders wrote: > > Hi, > > > > I'm trying to trace down a database upgrade bug and need to > figure out a > > way of simulating market upgrades. > > > > Currently what I'm doing is: > > > > $ adb install -r MyApplication_versionX.apk > > > > My database upgrade is pretty straightforward (delete all the tables > > then re-create them) though for some reason I'm getting a bunch > of bugs > > from users where the new columns are missing. > > > > Has anyone else had a similar issue? Is it hardware specific or > could > > something else be causing it? > > > > Thanks a bunch in advance. > > > > I've done this quite a bit, haven't come across any specific issues. > That's currently how I test it, as I think it gives the best chance of > preventing any database corruption. > Definitley a pain, as it requires more testing than normal. > > If you're not saving any data, an easier way might be to check the db > version in the extends application file. and just delete the database > if it's an old version. The app would then just recreate the > database > when it's opened. > Something like, > DB = DBAdapter.open(this); > if (DB.getVersion < x) { > DB.close(); > this.deleteDatabase ("mydb"); > } > > > > > > jarred > > > > > -- > Brad > -- CS