本文整理汇总了C#中Microsoft.Isam.Esent.Interop.Transaction.Rollback方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.Rollback方法的具体用法?C# Transaction.Rollback怎么用?C# Transaction.Rollback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Isam.Esent.Interop.Transaction
的用法示例。
在下文中一共展示了Transaction.Rollback方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRollbackAndBegin
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: PopImpl
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: TestRollbackThrowsExceptionWhenDisposed
public void TestRollbackThrowsExceptionWhenDisposed()
{
var transaction = new Transaction(this.sesid);
transaction.Dispose();
transaction.Rollback();
}
示例4: TestDoubleTransactionRollbackThrowsException
public void TestDoubleTransactionRollbackThrowsException()
{
using (var transaction = new Transaction(this.sesid))
{
transaction.Rollback();
transaction.Rollback();
}
}