title: Android SQLite Update not working in background in AsyncTask
body: <p>I have an interesting problem. I have a SQLite update that I am performing within a AsyncTask on Android (because I also have had to do a ton of remote calls before doing the DB call). The code works like a charm, unless the application is pushed to the background (eg, using the Home button). The task continues to work in the background successfully, the DB call is made and returns 1 row changed, but the data never actually makes it to the DB. No errors or exceptions. Even stranger, the logs show everything working just fine - no exceptions, nada.
  Again, when NOT pushed to the background this works fine.</p>
  
  <p>The call:</p>
  
  <pre><code>    result = (sqlDB.update("FormInstance", values, "InstanceId=?",  new String[] { String.valueOf(form.getSubmissionId()) }) &gt; 0);
  </code></pre>
  
  <p>Also there is no transaction involved with this call (unless it is happening under the hood of the Android SQLite code).</p>
  
  <p>Anyone know of why this might be the case? Is there something that happens to DB connections or SQLLite that I am unaware of when pushed to the backround?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have tried wrapping the DB call with a begintransaction/endtrans without any success:</p>
  
  <pre><code>    sqlDB.beginTransaction();
      try {
          result = (sqlDB.update("FormInstance", values, "InstanceId=?",  new String[] { String.valueOf(form.getSubmissionId()) }) &gt; 0);
      }
      finally {
          sqlDB.endTransaction();
      }
  </code></pre>
  
  <p>Still acts as though it was successful but data never committed.Please note that I pulled the DB from the device and verified that it had NOT been updated.</p>