]> git.ktnx.net Git - mobile-ledger.git/commitdiff
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 69b43fa6169cccd12826d483496959d79cf7bf24..f9297f0089e28542ba8c60c2f29feba6da6ed57f 100644 (file)
@@ -438,7 +438,6 @@ public class RetrieveTransactionsTask
                 db.endTransaction();
             }
         }
-
         return true;
     }
     private boolean retrieveTransactionList(MobileLedgerProfile profile)
index e466d3d906312d440808e68957e5b9bcfcbb0b47..9d87d0c8e73fbb9d62ce44956a8386b11945df38 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});