/** * @return true if this operation is mergeable with the given operation. Checks for null, {@link #FLAG_MERGE_TX}, * and if the database instances match. */ boolean isMergeableWith(AsyncOperation other) { return other != null && isMergeTx() && other.isMergeTx() && getDatabase() == other.getDatabase(); }
private void executeTransactionRunnable(AsyncOperation operation) { Database db = operation.getDatabase(); db.beginTransaction(); try { ((Runnable) operation.parameter).run(); db.setTransactionSuccessful(); } finally { db.endTransaction(); } }
@SuppressWarnings("unchecked") private void executeTransactionCallable(AsyncOperation operation) throws Exception { Database db = operation.getDatabase(); db.beginTransaction(); try { operation.result = ((Callable<Object>) operation.parameter).call(); db.setTransactionSuccessful(); } finally { db.endTransaction(); } }
mergedOps.add(operation2); Database db = operation1.getDatabase(); db.beginTransaction(); boolean success = false;
/** * @return true if this operation is mergeable with the given operation. Checks for null, {@link #FLAG_MERGE_TX}, * and if the database instances match. */ boolean isMergeableWith(AsyncOperation other) { return other != null && isMergeTx() && other.isMergeTx() && getDatabase() == other.getDatabase(); }
private void executeTransactionRunnable(AsyncOperation operation) { Database db = operation.getDatabase(); db.beginTransaction(); try { ((Runnable) operation.parameter).run(); db.setTransactionSuccessful(); } finally { db.endTransaction(); } }
@SuppressWarnings("unchecked") private void executeTransactionCallable(AsyncOperation operation) throws Exception { Database db = operation.getDatabase(); db.beginTransaction(); try { operation.result = ((Callable<Object>) operation.parameter).call(); db.setTransactionSuccessful(); } finally { db.endTransaction(); } }
mergedOps.add(operation2); Database db = operation1.getDatabase(); db.beginTransaction(); boolean success = false;