]> git.ktnx.net Git - mobile-ledger.git/commit
speed up transaction storage a bit
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 20:43:55 +0000 (23:43 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 20:43:55 +0000 (23:43 +0300)
commit451569cb01799c684b210cd6839d68825092a117
tree0928836057075653c14a689e83216a7b3f902dfd
parentf824d0b5541c9b7af2524d39813838ba131468f9
speed up transaction storage a bit

by updating existing records in-place. sqlite's insert or replace
statement tries insert, and when that fails because of unique/primary
key violation *removes* the existing record together with any child
records and then retries the insert. it is almost like deleting all the
transactions and inserting them again, but with a failed insert before
that
app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java
app/src/main/java/net/ktnx/mobileledger/dao/TransactionAccountDAO.java
app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java
app/src/main/java/net/ktnx/mobileledger/db/Transaction.java
app/src/main/java/net/ktnx/mobileledger/db/TransactionAccount.java