• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ITransaction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ITransaction的典型用法代码示例。如果您正苦于以下问题:C# ITransaction类的具体用法?C# ITransaction怎么用?C# ITransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITransaction类属于命名空间,在下文中一共展示了ITransaction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnNewTransaction

 private void OnNewTransaction(ITransaction transaction, TransactionMode transactionMode, IsolationMode isolationMode, bool distributedTransaction)
 {
     if (!transaction.DistributedTransaction)
     {
         transaction.Enlist(new RhinoTransactionResourceAdapter(transactionMode));
     }
 }
开发者ID:JackWangCUMT,项目名称:rhino-tools,代码行数:7,代码来源:RhinoTransactionFacility.cs


示例2: SchemaManager

        public SchemaManager(ITransaction transaction)
        {
            if (transaction == null)
                throw new ArgumentNullException("transaction");

            Transaction = transaction;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:SchemaManager.cs


示例3: DetachFrom

        public void DetachFrom(ITransaction transaction)
        {
            transaction.UnregisterOnCommit(OnCommit);

            if (transaction is ICallbackHandler)
                ((ICallbackHandler)transaction).OnCallbackDetached(this);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:TableCommitCallback.cs


示例4: AttachTo

        public void AttachTo(ITransaction transaction)
        {
            transaction.RegisterOnCommit(OnCommit);

            if (transaction is ICallbackHandler)
                ((ICallbackHandler)transaction).OnCallbackAttached(this);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:TableCommitCallback.cs


示例5: UnitOfWorkSynchronization

 /// <summary>
 /// ���캯��
 /// </summary>
 public UnitOfWorkSynchronization(ITransaction transaction, UnitOfWorkDelegate unitOfWorkDelegate)
 {
     _transaction = transaction;
     _unitOfWorkDelegate = unitOfWorkDelegate;
     _asyncMessageBus = DependencyResolver.Resolve<IAsyncMessageBus>();
     _logger = DependencyResolver.Resolve<ILoggerFactory>().Create("EventSourcing.UnitOfWorkSynchronization");
 }
开发者ID:sampson890727,项目名称:eventsourcing,代码行数:10,代码来源:UnitOfWorkSynchronization.cs


示例6: Insert

        public Dictionary<string, object> Insert(string tableName, Dictionary<string, object> row, ITransaction transaction = null)
        {
            if (!DataStore.ContainsKey(tableName))
                DataStore.Add(tableName, new FakeDBTable());

            var table = DataStore[tableName];

            var dictToUse = row.Copy();
            //var id = DataStore[tableName].Count + 1;
            var primaryKeys = Analyzer.GetPrimaryKeys(tableName);
            var autoKey = Analyzer.GetAutoNumberKey(tableName);

            if (autoKey != null)
            {
                if (!dictToUse.ContainsKey(autoKey))
                    dictToUse.Add(autoKey, table.NextAutoKey++);
                else
                    dictToUse[autoKey] = table.NextAutoKey++;
            }

            var invalid = primaryKeys.Where(key => dictToUse[key] == null);
            if (invalid.Any())
                throw new KeyNotSetException(tableName, invalid);

            table.Add(dictToUse);
            return dictToUse.WhereKeys(key => primaryKeys.Contains(key));
        }
开发者ID:TrinityWestern,项目名称:Lasy,代码行数:27,代码来源:FakeDB.cs


示例7: RawRead

        public IEnumerable<Dictionary<string, object>> RawRead(string tableName, Dictionary<string, object> id, ITransaction transaction = null)
        {
            if (!DataStore.ContainsKey(tableName))
                return new List<Dictionary<string, object>>();

            return DataStore[tableName].FindByFieldValues(id);
        }
开发者ID:TrinityWestern,项目名称:Lasy,代码行数:7,代码来源:FakeDB.cs


示例8: RawReadAll

        public IEnumerable<Dictionary<string, object>> RawReadAll(string tableName, ITransaction transaction = null)
        {
            if (!DataStore.ContainsKey(tableName))
                return new List<Dictionary<string, object>>();

            return DataStore[tableName];
        }
开发者ID:TrinityWestern,项目名称:Lasy,代码行数:7,代码来源:FakeDB.cs


示例9: TransactionElection

        public TransactionElection(ITransaction transaction)
        {
            if (transaction == null)
            throw new ArgumentNullException("transaction");

             _transaction = transaction;
        }
开发者ID:bsimser,项目名称:xeva,代码行数:7,代码来源:TransactionElection.cs


示例10: RoutineManager

        public RoutineManager(ITransaction transaction)
        {
            if (transaction == null)
                throw new ArgumentNullException("transaction");

            this.transaction = transaction;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:RoutineManager.cs


示例11: SelectUserProfilesCommand

    // User profiles

    public static IDbCommand SelectUserProfilesCommand(ITransaction transaction, Guid? profileId, string name,
        out int profileIdIndex, out int nameIndex)
    {
      ISQLDatabase database = transaction.Database;
      IDbCommand result = transaction.CreateCommand();
      result.CommandText = "SELECT PROFILE_ID, NAME FROM USER_PROFILES";

      IList<string> filters = new List<string>(2);
      if (profileId.HasValue)
        filters.Add("[email protected]_ID");
      if (!string.IsNullOrEmpty(name))
        filters.Add("[email protected]");

      if (filters.Count > 0)
        result.CommandText += " WHERE " + StringUtils.Join(" AND ", filters);

      if (profileId.HasValue)
        database.AddParameter(result, "PROFILE_ID", profileId, typeof(Guid));
      if (!string.IsNullOrEmpty(name))
        database.AddParameter(result, "NAME", name, typeof(string));

      profileIdIndex = 0;
      nameIndex = 1;
      return result;
    }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:27,代码来源:UserProfileDataManagement_SubSchema.cs


示例12: UnitOfWork

 public UnitOfWork(IProvider dataProvider)
 {
     provider = dataProvider as Provider;
     if (provider == null)
         throw new Exception("Invalid Data Provider");
     transaction = provider.Session.BeginTransaction();
 }
开发者ID:SpectralAngel,项目名称:Antem,代码行数:7,代码来源:UnitOfWork.cs


示例13: SessionInitializeTransaction

 protected void SessionInitializeTransaction()
 {
     if (session == null) {
         session = NHibernateHelper.OpenSession ();
         tx = session.BeginTransaction ();
     }
 }
开发者ID:pablovargan,项目名称:winforms-ooh4ria,代码行数:7,代码来源:BasicCAD.cs


示例14: if

 //查找用户的基本套餐
 public Int32 getId(Int64 num)
 {
     trans = session.BeginTransaction();
     try
     {
         IEnumerable<Rule> rule = session.CreateQuery("from Rule as c where c.Mobilenumber='" + num + "'").List<Rule>();
         Int32 id = 0;
         foreach (Rule r in rule)
         {
             if (r.Chargeid == 1)
             {
                 id = 1;
                 break;
             }
             else if (r.Chargeid == 2)
             {
                 id = 2;
                 break;
             }
             else if (r.Chargeid == 3)
             {
                 id = 3;
                 break;
             }
             else continue;
         }
         return id;
     }
     catch (Exception)
     {
         throw new Exception();
     }
 }
开发者ID:kutang,项目名称:mobile,代码行数:34,代码来源:RuleDao.cs


示例15: Dispose

        public void Dispose()
        {
            if (disposed)
                return;

            if (session == null)
                return;

            try
            {
                if (preventCommit)
                    transaction.Rollback();
                else
                    transaction.Commit();
            }
            catch
            {
                transaction.Rollback();
                throw;
            }
            finally
            {
                transaction.Dispose();
            }

            session.Dispose();
            session = null;
            transaction = null;
            disposed = true;
        }
开发者ID:BrandyFx,项目名称:Brandy,代码行数:30,代码来源:DefaultSessionProvider.cs


示例16: Setup

 public void Setup()
 {
     session = WindsorPersistenceFixture.Container.Resolve<ISession>();
     repository = new SecurityRepository();
     repository.Session = session;
     tx = session.BeginTransaction();
 }
开发者ID:PolishDev,项目名称:shop-manager,代码行数:7,代码来源:SecurityRepositoryTests.cs


示例17: BeginTransaction

 public void BeginTransaction()
 {
     if (_transaction == null)
     {
         _transaction = Session.BeginTransaction();
     }
 }
开发者ID:RodolfoTI,项目名称:NHibernateBootstrap,代码行数:7,代码来源:UnitOfWorkBase.cs


示例18: Start

 public void Start()
 {
     _session = _sessionSource.CreateSession();
     _session.FlushMode = FlushMode.Commit;
     _transaction = _session.BeginTransaction();
     _isInitialized = true;
 }
开发者ID:rauhryan,项目名称:warmup-templates,代码行数:7,代码来源:NHibernateTransactionBoundary.cs


示例19: UnitOfWork

 public UnitOfWork(ISessionFactory sessionFactory)
 {
     _sessionFactory = sessionFactory;
     CurrentSession = _sessionFactory.OpenSession();
     //CurrentSession.EnableFilter("translationFilter").SetParameter("locale", Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName);
     _transaction = CurrentSession.BeginTransaction();
 }
开发者ID:ankitkumar9018,项目名称:SampleSolrApp,代码行数:7,代码来源:UnitOfWork.cs


示例20: Intercept

        public void Intercept(IInvocation invocation)
        {
            var sessionFactories = NHibernateSessionManager.SessionFactories;
            var method = invocation.Method;
            var isTransactionScoped = method.IsDecoratedBy(typeof(TransactionAttribute));

            if (isTransactionScoped) {
                foreach (var sessionFactory in sessionFactories)
                {
                    var session = sessionFactory.GetSession();

                    _transaction = sessionFactory.GetSession().Transaction.IsActive
                                ? _session.Transaction
                                : _session.BeginTransaction();
                }
                _transaction = _session.Transaction;

                try {
                    invocation.Proceed();

                    _transaction.Commit();
                } catch (Exception) {
                    _transaction.Rollback();

                    throw;
                } finally {
                    _transaction.Dispose();
                }
            }
        }
开发者ID:gofixiao,项目名称:Macsauto-Backup,代码行数:30,代码来源:TransactionInterceptor.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITransactionContext类代码示例发布时间:2022-05-24
下一篇:
C# ITrackingSpan类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap