private void endMicroTransaction(boolean success) { assert microTransaction != null; try { if (success) try { microTransaction.commit(); OLiveQueryHook.notifyForTxChanges(this); OLiveQueryHookV2.notifyForTxChanges(this); } catch (Exception e) { microTransaction.rollbackAfterFailedCommit(); OLiveQueryHook.removePendingDatabaseOps(this); OLiveQueryHookV2.removePendingDatabaseOps(this); throw e; } else { microTransaction.rollback(); OLiveQueryHook.removePendingDatabaseOps(this); OLiveQueryHookV2.removePendingDatabaseOps(this); } } finally { if (!microTransaction.isActive()) microTransaction = null; } }