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; }
public void beginTransactionNonExclusive() throws SQLiteBridgeException { if (inTransaction()) { throw new SQLiteBridgeException("Nested transactions are not supported"); } execSQL("BEGIN IMMEDIATE"); mTransactionSuccess = false; mInTransaction = true; }