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


C# OleDbTransaction.BeginInternal方法代码示例

本文整理汇总了C#中System.Data.OleDb.OleDbTransaction.BeginInternal方法的典型用法代码示例。如果您正苦于以下问题:C# OleDbTransaction.BeginInternal方法的具体用法?C# OleDbTransaction.BeginInternal怎么用?C# OleDbTransaction.BeginInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.OleDb.OleDbTransaction的用法示例。


在下文中一共展示了OleDbTransaction.BeginInternal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Begin

 public OleDbTransaction Begin(System.Data.IsolationLevel isolevel)
 {
     OleDbTransaction transaction2;
     IntPtr ptr;
     OleDbConnection.ExecutePermission.Demand();
     Bid.ScopeEnter(out ptr, "<oledb.OleDbTransaction.Begin|API> %d#, isolevel=%d{IsolationLevel}", this.ObjectID, (int) isolevel);
     try
     {
         if (this._transaction == null)
         {
             throw ADP.TransactionZombied(this);
         }
         if ((this._nestedTransaction != null) && this._nestedTransaction.IsAlive)
         {
             throw ADP.ParallelTransactionsNotSupported(this.Connection);
         }
         OleDbTransaction target = new OleDbTransaction(this._parentConnection, this, isolevel);
         this._nestedTransaction = new WeakReference(target, false);
         UnsafeNativeMethods.ITransactionLocal transaction = null;
         try
         {
             transaction = (UnsafeNativeMethods.ITransactionLocal) this._transaction.ComWrapper();
             target.BeginInternal(transaction);
         }
         finally
         {
             if (transaction != null)
             {
                 Marshal.ReleaseComObject(transaction);
             }
         }
         transaction2 = target;
     }
     finally
     {
         Bid.ScopeLeave(ref ptr);
     }
     return transaction2;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:39,代码来源:OleDbTransaction.cs

示例2: Begin

        public OleDbTransaction Begin(IsolationLevel isolevel) {
            OleDbConnection.ExecutePermission.Demand(); // MDAC 81476

            IntPtr hscp;
            Bid.ScopeEnter(out hscp, "<oledb.OleDbTransaction.Begin|API> %d#, isolevel=%d{IsolationLevel}", ObjectID, (int)isolevel);
            try {
                if (null == _transaction) {
                    throw ADP.TransactionZombied(this);
                }
                else if ((null != _nestedTransaction) && _nestedTransaction.IsAlive) {
                    throw ADP.ParallelTransactionsNotSupported(Connection);
                }
                // either the connection will be open or this will be a zombie

                OleDbTransaction transaction = new OleDbTransaction(_parentConnection, this, isolevel);
                _nestedTransaction = new WeakReference(transaction, false);

                UnsafeNativeMethods.ITransactionLocal wrapper = null;
                try {
                    wrapper = (UnsafeNativeMethods.ITransactionLocal)_transaction.ComWrapper();
                    transaction.BeginInternal(wrapper);
                }
                finally {
                    if (null != wrapper) {
                        Marshal.ReleaseComObject(wrapper);
                    }
                }
                return transaction;
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:33,代码来源:OleDbTransaction.cs

示例3: BeginTransaction

        override public DbTransaction BeginTransaction(IsolationLevel isolationLevel) {
            OleDbConnection.ExecutePermission.Demand();

            OleDbConnection outerConnection = Connection;
            if (null != LocalTransaction) {
                throw ADP.ParallelTransactionsNotSupported(outerConnection);
            }

            object unknown = null;
            OleDbTransaction transaction;
            try {
                transaction = new OleDbTransaction(outerConnection, null, isolationLevel);

                Bid.Trace("<oledb.IUnknown.QueryInterface|API|OLEDB|session> %d#, ITransactionLocal\n", ObjectID);
                Debug.Assert(null != _datasrcwrp, "ITransactionLocal: null datasource");
                Debug.Assert(null != _sessionwrp, "ITransactionLocal: null session");
                unknown = _sessionwrp.ComWrapper();
                UnsafeNativeMethods.ITransactionLocal value = (unknown as UnsafeNativeMethods.ITransactionLocal);
                if (null == value) {
                    throw ODB.TransactionsNotSupported(Provider, (Exception)null);
                }
                transaction.BeginInternal(value);
            }
            finally {
                if (null != unknown) {
                    Marshal.ReleaseComObject(unknown);
                }
            }
            LocalTransaction = transaction;
            return transaction;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:31,代码来源:OleDbConnectionInternal.cs


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