From: Damyan Ivanov Date: Sun, 24 Mar 2019 09:39:58 +0000 (+0200) Subject: commit right after the account list is complete X-Git-Tag: v0.8.1~18 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=131b3a80243191d4cebd2df70e8836d7dbebaaa8;p=mobile-ledger.git commit right after the account list is complete the transaction list can be updated in its own transaction shorter transactions - happier database --- diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index dc739443..69b43fa6 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -159,7 +159,13 @@ public class RetrieveTransactionsTask if (line.equals("

General Journal

")) { state = ParserState.EXPECTING_TRANSACTION; L("→ expecting transaction"); + // commit the current transaction and start a new one + // the account list in the UI should reflect the (committed) + // state of the database + db.setTransactionSuccessful(); + db.endTransaction(); Data.accounts.set(accountList); + db.beginTransaction(); continue; } m = reAccountName.matcher(line);