public void Commit() { try { try { this.OnClosing(false); } finally { try { Native.Execute(lib => lib.mdb_txn_commit(_handle)); } catch (LightningException) { this.Abort(false); throw; } this.State = LightningTransacrionState.Commited; } } finally { this.DetachClosingHandler(); } }
public void Reset() { if (!this.IsReadOnly) { throw new InvalidOperationException("Can't reset non-readonly transaction"); } Native.Library.mdb_txn_reset(_handle); this.State = LightningTransacrionState.Reseted; }
public void Renew() { if (!this.IsReadOnly) { throw new InvalidOperationException("Can't renew non-readonly transaction"); } if (this.State != LightningTransacrionState.Reseted) { throw new InvalidOperationException("Transaction should be reseted first"); } Native.Library.mdb_txn_renew(_handle); this.State = LightningTransacrionState.Active; }
private void Abort(bool environmentClosing) { try { try { this.OnClosing(environmentClosing); } finally { Native.Library.mdb_txn_abort(_handle); } } finally { this.DetachClosingHandler(); this.State = LightningTransacrionState.Aborted; } }
private void Abort(bool environmentClosing) { try { try { this.OnClosing(environmentClosing); } finally { Native.mdb_txn_abort(_handle); } } finally { this.DetachClosingHandler(); this.State = LightningTransacrionState.Aborted; } }
public void Commit() { try { try { this.OnClosing(false); } finally { try { Native.Execute(() => Native.mdb_txn_commit(_handle)); } catch (LightningException) { this.Abort(false); throw; } this.State = LightningTransacrionState.Commited; } } finally { this.DetachClosingHandler(); } }
public void Renew() { if (!this.IsReadOnly) throw new InvalidOperationException("Can't renew non-readonly transaction"); if (this.State != LightningTransacrionState.Reseted) throw new InvalidOperationException("Transaction should be reseted first"); Native.mdb_txn_renew(_handle); this.State = LightningTransacrionState.Active; }
public void Reset() { if (!this.IsReadOnly) throw new InvalidOperationException("Can't reset non-readonly transaction"); Native.mdb_txn_reset(_handle); this.State = LightningTransacrionState.Reseted; }