title: understanding updateWithOnConflict
body: <p>I am working with a simple database.  It has three columns.  _id (integer primary key autoincrement), jobnumber (text unique not null) and jobpart (text not null).</p>
  
  <p>Everything works fine until I try and update a record and enter an existing jobnumber.  When I do that the app crashes and I get a force close.</p>
  
  <p>I'm using updateWithOnConflict and I thought that caused things to exit gracefully and return a code.  Not sure if I'm merely not understanding or if I've done something wrong...</p>
  
  <p>Any help appreciated.</p>
  
  <p>update code snippet:</p>
  
  <pre><code>    public int updateJob(long rowId, String jobnumber, String jobpart) {
          ContentValues args = new ContentValues();
          args.put(JOB_NUMBER, jobnumber);
          args.put(JOB_PART, jobpart);
  
          return mDb.updateWithOnConflict(JOB_TABLE, args, JOB_ROWID + "=" + rowId, null, SQLiteDatabase.CONFLICT_ROLLBACK);
      }
  </code></pre>
  
  <p>output from LogCat:</p>
  
  <pre><code>FATAL EXCEPTION: main
  android.database.sqlite.SQLiteException: cannot commit - no transaction is active
  at android.database.sqlite.SQLiteStatement.native_executeSql(Native Method)
  at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:89)
  at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1933)
  at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1864)
  at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:688)
  at android.database.sqlite.SQLiteStatement.releaseAndUnlock(SQLiteStatement.java:266)
  at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:96)
  at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1829)
  at cdc.gridtest.ScheduleDBAdapter.updateJob(ScheduleDBAdapter.java:325)
  at cdc.gridtest.JobEdit.saveState(JobEdit.java:104)
  at cdc.gridtest.JobEdit.access$0(JobEdit.java:90)
  at cdc.gridtest.JobEdit$1.onClick(JobEdit.java:47)
  at android.view.View.performClick(View.java:3110)
  at android.view.View$PerformClick.run(View.java:11934)
  at android.os.Handler.handleCallback(Handler.java:587)
  at android.os.Handler.dispatchMessage(Handler.java:92)
  at android.os.Looper.loop(Looper.java:132)
  at android.app.ActivityThread.main(ActivityThread.java:4123)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:491)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>