From 131b3a80243191d4cebd2df70e8836d7dbebaaa8 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 24 Mar 2019 11:39:58 +0200 Subject: [PATCH] commit right after the account list is complete the transaction list can be updated in its own transaction shorter transactions - happier database --- .../ktnx/mobileledger/async/RetrieveTransactionsTask.java | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.5