当前位置: 首页>>代码示例>>C#>>正文


C# Isolation类代码示例

本文整理汇总了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);
 }
开发者ID:mcandre,项目名称:db,代码行数:15,代码来源:HeapDatabase.cs

示例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);
 }
开发者ID:mcandre,项目名称:db,代码行数:39,代码来源:HeapDatabase.cs

示例3: CursorConfig

 /// <summary>
 /// Instantiate a new CursorConfig object
 /// </summary>
 public CursorConfig()
 {
     IsolationDegree = Isolation.DEGREE_THREE;
     Priority = CachePriority.DEFAULT;
 }
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:8,代码来源:CursorConfig.cs

示例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();
            }
        }
开发者ID:gildafnai82,项目名称:craq,代码行数:34,代码来源:CursorTest.cs

示例5: LockingInfo

 /// <summary>
 /// Instantiate a new LockingInfo object
 /// </summary>
 public LockingInfo()
 {
     IsolationDegree = Isolation.DEGREE_THREE;
     ReadModifyWrite = false;
 }
开发者ID:mania25,项目名称:diy-project,代码行数:8,代码来源:LockingInfo.cs

示例6: CursorConfig

 /// <summary>
 /// Instantiate a new CursorConfig object
 /// </summary>
 public CursorConfig() {
     IsolationDegree = Isolation.DEGREE_THREE;
 }
开发者ID:gildafnai82,项目名称:craq,代码行数:6,代码来源:CursorConfig.cs

示例7: TransactionConfig

 /// <summary>
 /// Instantiate a new TransactionConfig object
 /// </summary>
 public TransactionConfig()
 {
     IsolationDegree = Isolation.DEGREE_THREE;
     SyncAction = LogFlush.DEFAULT;
 }
开发者ID:kanbang,项目名称:Colt,代码行数:8,代码来源:TransactionConfig.cs

示例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);
            }
        }
开发者ID:mania25,项目名称:diy-project,代码行数:22,代码来源:Configuration.cs

示例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;
        }
开发者ID:mania25,项目名称:diy-project,代码行数:24,代码来源:Configuration.cs


注:本文中的Isolation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。