示例#1
0
  public void endTransaction() {
    if (!inTransaction()) return;

    try {
      if (mTransactionSuccess) {
        execSQL("COMMIT TRANSACTION");
      } else {
        execSQL("ROLLBACK TRANSACTION");
      }
    } catch (SQLiteBridgeException ex) {
      Log.e(LOGTAG, "Error ending transaction", ex);
    }
    mInTransaction = false;
    mTransactionSuccess = false;
  }
示例#2
0
 public void beginTransactionNonExclusive() throws SQLiteBridgeException {
   if (inTransaction()) {
     throw new SQLiteBridgeException("Nested transactions are not supported");
   }
   execSQL("BEGIN IMMEDIATE");
   mTransactionSuccess = false;
   mInTransaction = true;
 }