title: Intermittent SQLiteException: not an error at dbopen
body: <p>In my app I'm using DB in many situations, but there is one situation in which I'm getting an exception, not every time and could reproduce it (yet).</p>
  <p>This is happening only on OS versions 2.3.7 and 2.1-update-1.</p>
  <p>The code:</p>
  <pre><code>public void removeOldOccurrences() {
          SQLiteDatabase db = dbHelper.getWritableDatabase();
          Long oldTime = System.currentTimeMillis() - VALID_OCCURRENCE_TIME;
          String query = &quot;&quot;;
          try {
              query = &quot;DELETE FROM &quot; + LOCATIONS_TABLE + &quot; WHERE not (&quot;
                      + REMEMBERED_FIELD + &quot;=1) &quot; + &quot;and (&quot; + LAST_FIELD + &quot;&lt;&quot;
                      + oldTime + &quot;);&quot;;
              db.execSQL(query);
          } catch (Exception e) {
              Log.e(TAG, query);
              e.printStackTrace();
          } finally {
              if (db != null) {
                  db.close();
              }
          }
      }
  </code></pre>
  <p>The exception trace is:</p>
  <pre><code>android.database.sqlite.SQLiteException: not an error
  at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
  at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1849)
  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)
  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)
  at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:573)
  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
  </code></pre>
  <p>please help.</p>