beginTransaction should be outside the try{} block
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 24 Mar 2019 09:41:27 +0000 (11:41 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 25 Mar 2019 06:17:36 +0000 (06:17 +0000)
app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java
app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java

index 69b43fa..f9297f0 100644 (file)
@@ -438,7 +438,6 @@ public class RetrieveTransactionsTask
                 db.endTransaction();
             }
         }
-
         return true;
     }
     private boolean retrieveTransactionList(MobileLedgerProfile profile)
index e466d3d..9d87d0c 100644 (file)
@@ -283,8 +283,8 @@ public final class MobileLedgerProfile {
     public void removeFromDB() {
         SQLiteDatabase db = MLDB.getDatabase();
         Log.d("db", String.format("removing profile %s from DB", uuid));
+        db.beginTransaction();
         try {
-            db.beginTransaction();
             db.execSQL("delete from profiles where uuid=?", new Object[]{uuid});
             db.execSQL("delete from accounts where profile=?", new Object[]{uuid});
             db.execSQL("delete from account_values where profile=?", new Object[]{uuid});