Rollback() public method

Rollback a transaction. This object should be in a transaction.
public Rollback ( ) : void
return void
コード例 #1
0
 public void CreateRollbackAndBegin()
 {
     using (var transaction = new Transaction(this.sesid))
     {
         Assert.IsTrue(transaction.IsInTransaction);
         transaction.Rollback();
         Assert.IsFalse(transaction.IsInTransaction);
         transaction.Begin();
         Assert.IsTrue(transaction.IsInTransaction);
     }
 }
コード例 #2
0
        protected override CrawlerQueueEntry PopImpl()
        {
            return m_EsentInstance.Cursor((session, dbid) =>
                {
                    using (Transaction transaction = new Transaction(session))
                    {
                        using (Table table = new Table(session, dbid, EsentTableDefinitions.QueueTableName, OpenTableGrbit.None))
                        {
                            if (Api.TryMoveFirst(session, table))
                            {
                                byte[] data = Api.RetrieveColumn(session, table, dataColumn.columnid);
                                Api.JetDelete(session, table);

                                using (Table table2 = new Table(session, dbid, EsentTableDefinitions.GlobalsTableName, OpenTableGrbit.None))
                                {
                                    Api.EscrowUpdate(session, table2, queueCountColumn.columnid, -1);
                                }

                                transaction.Commit(CommitTransactionGrbit.None);
                                return data.FromBinary<CrawlerQueueEntry>();
                            }
                        }

                        transaction.Rollback();
                        return null;
                    }
                });
        }
コード例 #3
0
ファイル: TransactionTests.cs プロジェクト: jtmueller/ravendb
 public void TestRollbackThrowsExceptionWhenDisposed()
 {
     var transaction = new Transaction(this.sesid);
     transaction.Dispose();
     transaction.Rollback();
 }
コード例 #4
0
ファイル: TransactionTests.cs プロジェクト: jtmueller/ravendb
 public void TestDoubleTransactionRollbackThrowsException()
 {
     using (var transaction = new Transaction(this.sesid))
     {
         transaction.Rollback();
         transaction.Rollback();
     }
 }
コード例 #5
0
ファイル: XbimTransaction.cs プロジェクト: keremer/inFizYon
 public void Rollback()
 {
     //_undoRedoSession.Rollback();
     _dbTransaction.Rollback();
 }