Beispiel #1
0
 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();
     }
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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;
        }
Beispiel #4
0
 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;
        }