X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FMobileLedgerProfile.java;h=347e1142408e22ff99c71902938846140dd26722;hb=ca3f055618327ec7e12ad7e23705e0909c96e0dc;hp=1f2eac7360acc17e5356fa39387363297cc24d63;hpb=6603a66690138661b04ad9c56d4b3498e64eef95;p=mobile-ledger-staging.git diff --git a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java index 1f2eac73..347e1142 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java @@ -109,7 +109,7 @@ public final class MobileLedgerProfile { } public static void storeProfilesOrder() { SQLiteDatabase db = App.getDatabase(); - db.beginTransaction(); + db.beginTransactionNonExclusive(); try { int orderNo = 0; for (MobileLedgerProfile p : Data.profiles.getValue()) { @@ -204,7 +204,7 @@ public final class MobileLedgerProfile { } public void storeInDB() { SQLiteDatabase db = App.getDatabase(); - db.beginTransaction(); + db.beginTransactionNonExclusive(); try { // debug("profiles", String.format("Storing profile in DB: uuid=%s, name=%s, " + // "url=%s, permit_posting=%s, authEnabled=%s, " + @@ -260,9 +260,9 @@ public final class MobileLedgerProfile { for (LedgerTransactionAccount item : tr.getAccounts()) { db.execSQL("INSERT INTO transaction_accounts(profile, transaction_id, " + - "account_name, amount, currency) values(?, ?, ?, ?, ?)", + "account_name, amount, currency, comment) values(?, ?, ?, ?, ?, ?)", new Object[]{uuid, tr.getId(), item.getAccountName(), item.getAmount(), - item.getCurrency() + item.getCurrency(), item.getComment() }); } // debug("profile", String.format("Transaction %d stored", tr.getId())); @@ -323,7 +323,7 @@ public final class MobileLedgerProfile { public void removeFromDB() { SQLiteDatabase db = App.getDatabase(); debug("db", String.format("removing profile %s from DB", uuid)); - db.beginTransaction(); + db.beginTransactionNonExclusive(); try { Object[] uuid_param = new Object[]{uuid}; db.execSQL("delete from profiles where uuid=?", uuid_param);