Bug 754453 - BrowserProvider insert failures are silent. r=blassey a=mfinkle
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Tue, 15 May 2012 15:13:28 +0200
changeset 95761 0c1c0aa121af920f661d283318d45c98c7d1a924
parent 95760 c6e3fafe4fb7544dd50e19335ba7cb2cfe89bfea
child 95762 2919c14e90bd0a45478967dfad637863fe10b79d
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey, mfinkle
bugs754453
milestone14.0a2
Bug 754453 - BrowserProvider insert failures are silent. r=blassey a=mfinkle
mobile/android/base/db/BrowserProvider.java.in
--- a/mobile/android/base/db/BrowserProvider.java.in
+++ b/mobile/android/base/db/BrowserProvider.java.in
@@ -2150,16 +2150,23 @@ public class BrowserProvider extends Con
                 // isn't IGNORE). We still need to set it as successful to let
                 // everything before the failed op go through.
                 // We can't set conflict resolution on API level < 8, and even
                 // above 8 it requires splitting the call per operation
                 // (insert/update/delete).
                 db.setTransactionSuccessful();
                 db.endTransaction();
                 db.beginTransaction();
+            } catch (OperationApplicationException e) {
+                // Repeat of above.
+                results[i] = new ContentProviderResult(0);
+                failures = true;
+                db.setTransactionSuccessful();
+                db.endTransaction();
+                db.beginTransaction();
             }
         }
 
         trace("Flushing DB applyBatch...");
         db.setTransactionSuccessful();
         db.endTransaction();
 
         if (failures) {