]> git.ktnx.net Git - mobile-ledger.git/commitdiff
use non-exclusive mode for write-enabled transactions
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 31 Dec 2019 15:44:50 +0000 (17:44 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 31 Dec 2019 15:44:50 +0000 (17:44 +0200)
app/src/main/java/net/ktnx/mobileledger/async/CommitAccountsTask.java
app/src/main/java/net/ktnx/mobileledger/async/RefreshDescriptionsTask.java
app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java

index bde0156ffaf20c3035a83319f3a4aeaa65b0795d..00b33336e405930588fa854b96a7b1bf8a093687 100644 (file)
@@ -38,7 +38,7 @@ public class CommitAccountsTask
         try {
 
             SQLiteDatabase db = App.getDatabase();
-            db.beginTransaction();
+            db.beginTransactionNonExclusive();
             try {
                 try (LockHolder lh = params[0].accountList.lockForWriting()) {
                     for (int i = 0; i < params[0].accountList.size(); i++ ){
index 62885c1b82de1a34c829459d3d74fc6c997604e9..4276e97df79081090c2fc9b2bb84656a87d171c4 100644 (file)
@@ -39,7 +39,7 @@ public class RefreshDescriptionsTask extends AsyncTask<Void, Void, Void> {
 
         Data.backgroundTaskStarted();
         try {
-            db.beginTransaction();
+            db.beginTransactionNonExclusive();
             try {
                 db.execSQL("UPDATE description_history set keep=0");
                 try (Cursor c = db
index 1f2eac7360acc17e5356fa39387363297cc24d63..53896db045391996dd6d3d0d526dc343530cc435 100644 (file)
@@ -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, " +
@@ -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);