diff --git a/.gitignore b/.gitignore index 5779a310f..7b5e18920 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ local.properties bin/* proguard.cfg +*~ diff --git a/src/org/fdroid/fdroid/DB.java b/src/org/fdroid/fdroid/DB.java index 16a3899a7..ae8fe8c21 100644 --- a/src/org/fdroid/fdroid/DB.java +++ b/src/org/fdroid/fdroid/DB.java @@ -246,37 +246,25 @@ public class DB { @Override public void onCreate(SQLiteDatabase db) { - db.beginTransaction(); - try { - db.execSQL(CREATE_TABLE_REPO); - db.execSQL(CREATE_TABLE_APP); - db.execSQL(CREATE_TABLE_APK); - onUpgrade(db, 1, DB_UPGRADES.length + 1); - ContentValues values = new ContentValues(); - values.put("address", - mContext.getString(R.string.default_repo_address)); - values.put("pubkey", - mContext.getString(R.string.default_repo_pubkey)); - values.put("inuse", 1); - values.put("priority", 10); - db.insert(TABLE_REPO, null, values); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - } + db.execSQL(CREATE_TABLE_REPO); + db.execSQL(CREATE_TABLE_APP); + db.execSQL(CREATE_TABLE_APK); + onUpgrade(db, 1, DB_UPGRADES.length + 1); + ContentValues values = new ContentValues(); + values.put("address", + mContext.getString(R.string.default_repo_address)); + values.put("pubkey", + mContext.getString(R.string.default_repo_pubkey)); + values.put("inuse", 1); + values.put("priority", 10); + db.insert(TABLE_REPO, null, values); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - db.beginTransaction(); - try { - for (int v = oldVersion + 1; v <= newVersion; v++) - for (int i = 0; i < DB_UPGRADES[v - 2].length; i++) - db.execSQL(DB_UPGRADES[v - 2][i]); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - } + for (int v = oldVersion + 1; v <= newVersion; v++) + for (int i = 0; i < DB_UPGRADES[v - 2].length; i++) + db.execSQL(DB_UPGRADES[v - 2][i]); } }