]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix storing transaction accounts (bad typo)
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:10:46 +0000 (00:10 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:10:46 +0000 (00:10 +0300)
this is the fastest storage approach, next thing to try -- compare
existing records with the new-to-be and avoid the db update alltogether
if they are the same

app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java

index 9c3f21f2b3540f880d7aba7f391dddec615a1da3..9012d489ca08a7b5b71ea12b160a679650fb2598 100644 (file)
@@ -170,8 +170,7 @@ public abstract class TransactionDAO extends BaseDAO<Transaction> {
                     trAccDao.getByOrderNoSync(trAcc.getTransactionId(), trAcc.getOrderNo());
             if (existingAcc != null) {
                 existingAcc.copyDataFrom(trAcc);
-                trAccDao.updateSync(trAcc);
-                trAcc = existingAcc;
+                trAccDao.updateSync(existingAcc);
             }
             else
                 trAcc.setId(trAccDao.insertSync(trAcc));