本文整理汇总了C#中Isolation类的典型用法代码示例。如果您正苦于以下问题:C# Isolation类的具体用法?C# Isolation怎么用?C# Isolation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Isolation类属于命名空间,在下文中一共展示了Isolation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Stats
private HeapStats Stats(Transaction txn, bool fast, Isolation isoDegree)
{
uint flags = 0;
flags |= fast ? DbConstants.DB_FAST_STAT : 0;
switch (isoDegree) {
case Isolation.DEGREE_ONE:
flags |= DbConstants.DB_READ_UNCOMMITTED;
break;
case Isolation.DEGREE_TWO:
flags |= DbConstants.DB_READ_COMMITTED;
break;
}
HeapStatStruct st = db.stat_heap(Transaction.getDB_TXN(txn), flags);
return new HeapStats(st);
}
示例2: FastStats
/// <summary>
/// Return the database statistical information which does not require
/// traversal of the database.
/// </summary>
/// <overloads>
/// <para>
/// Among other things, this method makes it possible for applications
/// to request key and record counts without incurring the performance
/// penalty of traversing the entire database.
/// </para>
/// <para>
/// The statistical information is described by the
/// <see cref="BTreeStats"/>, <see cref="HashStats"/>,
/// <see cref="HeapStats"/>, <see cref="QueueStats"/>, and
/// <see cref="RecnoStats"/> classes.
/// </para>
/// </overloads>
/// <param name="txn">
/// If the operation is part of an application-specified transaction,
/// <paramref name="txn"/> is a Transaction object returned from
/// <see cref="DatabaseEnvironment.BeginTransaction"/>; if
/// the operation is part of a Berkeley DB Concurrent Data Store group,
/// <paramref name="txn"/> is a handle returned from
/// <see cref="DatabaseEnvironment.BeginCDSGroup"/>; otherwise null.
/// </param>
/// <param name="isoDegree">
/// The level of isolation for database reads.
/// <see cref="Isolation.DEGREE_ONE"/> will be silently ignored for
/// databases which did not specify
/// <see cref="DatabaseConfig.ReadUncommitted"/>.
/// </param>
/// <returns>
/// The database statistical information which does not require
/// traversal of the database.
/// </returns>
public HeapStats FastStats(Transaction txn, Isolation isoDegree)
{
return Stats(txn, true, isoDegree);
}
示例3: CursorConfig
/// <summary>
/// Instantiate a new CursorConfig object
/// </summary>
public CursorConfig()
{
IsolationDegree = Isolation.DEGREE_THREE;
Priority = CachePriority.DEFAULT;
}
示例4: TestIsolationDegree
public void TestIsolationDegree()
{
BTreeDatabase db;
BTreeCursor cursor;
CursorConfig cursorConfig;
DatabaseEnvironment env;
Transaction txn;
testName = "TestIsolationDegree";
testHome = testFixtureHome + "/" + testName;
Isolation[] isolationDegrees = new Isolation[3];
isolationDegrees[0] = Isolation.DEGREE_ONE;
isolationDegrees[1] = Isolation.DEGREE_TWO;
isolationDegrees[2] = Isolation.DEGREE_THREE;
IsolationDelegate[] delegates = {
new IsolationDelegate(CursorReadUncommited),
new IsolationDelegate(CursorReadCommited),
new IsolationDelegate(CursorRead)};
cursorConfig = new CursorConfig();
for (int i = 0; i < 3; i++)
{
cursorConfig.IsolationDegree = isolationDegrees[i];
GetCursorInBtreeDBInTDS(testHome + "/" + i.ToString(),
testName, cursorConfig, out env, out db,
out cursor, out txn);
cursor.Close();
db.Close();
txn.Commit();
env.Close();
}
}
示例5: LockingInfo
/// <summary>
/// Instantiate a new LockingInfo object
/// </summary>
public LockingInfo()
{
IsolationDegree = Isolation.DEGREE_THREE;
ReadModifyWrite = false;
}
示例6: CursorConfig
/// <summary>
/// Instantiate a new CursorConfig object
/// </summary>
public CursorConfig() {
IsolationDegree = Isolation.DEGREE_THREE;
}
示例7: TransactionConfig
/// <summary>
/// Instantiate a new TransactionConfig object
/// </summary>
public TransactionConfig()
{
IsolationDegree = Isolation.DEGREE_THREE;
SyncAction = LogFlush.DEFAULT;
}
示例8: ConfirmIsolation
public static void ConfirmIsolation(XmlElement xmlElem,
string name, Isolation value, bool compulsory)
{
XmlNode xmlNode;
int isolationDegree;
xmlNode = XMLReader.GetNode(xmlElem, name);
if (xmlNode == null && compulsory == true)
throw new ConfigNotFoundException(name);
else if (xmlNode != null)
{
isolationDegree = int.Parse(xmlNode.InnerText);
if (isolationDegree == 1)
Assert.AreEqual(Isolation.DEGREE_ONE, value);
else if (isolationDegree == 2)
Assert.AreEqual(Isolation.DEGREE_TWO, value);
else if (isolationDegree == 3)
Assert.AreEqual(Isolation.DEGREE_THREE, value);
else
throw new InvalidConfigException(name);
}
}
示例9: ConfigIsolation
public static bool ConfigIsolation(XmlElement xmlElem,
string name, ref Isolation value, bool compulsory)
{
XmlNode xmlNode;
int isolationDegree;
xmlNode = XMLReader.GetNode(xmlElem, name);
if (xmlNode == null && compulsory == false)
return false;
else if (xmlNode == null && compulsory == true)
throw new ConfigNotFoundException(name);
isolationDegree = int.Parse(xmlNode.InnerText);
if (isolationDegree == 1)
value = Isolation.DEGREE_ONE;
else if (isolationDegree == 2)
value = Isolation.DEGREE_TWO;
else if (isolationDegree == 3)
value = Isolation.DEGREE_THREE;
else
throw new InvalidConfigException(name);
return true;
}