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); } }
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; } }); }
public void TestRollbackThrowsExceptionWhenDisposed() { var transaction = new Transaction(this.sesid); transaction.Dispose(); transaction.Rollback(); }
public void TestDoubleTransactionRollbackThrowsException() { using (var transaction = new Transaction(this.sesid)) { transaction.Rollback(); transaction.Rollback(); } }
public void Rollback() { //_undoRedoSession.Rollback(); _dbTransaction.Rollback(); }