/// <summary> /// Use explicitly to undo the changes in a <see cref="Transaction"/>, otherwise it is automatically invoked by /// exiting the block. /// </summary> public void Rollback() { if (_realm == null) { throw new Exception("Transaction was already closed. Cannot roll back"); } _realm.SharedRealmHandle.CancelTransaction(); _realm.DrainTransactionQueue(); _realm = null; }
/// <summary> /// Use explicitly to undo the changes in a <see cref="Transaction"/>, otherwise it is automatically invoked by /// exiting the block. /// </summary> public void Rollback() { if (!_isOpen) { throw new Exception("Transaction was already closed. Cannot roll back"); } _realm.SharedRealmHandle.CancelTransaction(); _isOpen = false; _realm.DrainTransactionQueue(); }