예제 #1
0
        /// <summary>
        /// 获取当前数据库操作上下文
        /// </summary>
        /// <returns>OperateContext</returns>
        private OperateContext GetCurrentContext()
        {
            string szThreadID =
                Thread.CurrentThread.ManagedThreadId.ToString();
            OperateContext context = null;

            if (this.m_contexts.ContainsKey(szThreadID))
            {
                context = this.m_contexts[szThreadID];
            }
            if (context != null)
            {
                return(context);
            }
            context = new OperateContext(szThreadID
                                         , this.m_dbType, this.m_provider, this.m_connString);
            context.ClearPoolEnabled = this.m_bClearPoolEnabled;
            this.m_contexts.Add(szThreadID, context);
            return(context);
        }
예제 #2
0
 /// <summary>
 /// ��ȡ��ǰ���ݿ����������
 /// </summary>
 /// <returns>OperateContext</returns>
 private OperateContext GetCurrentContext()
 {
     string szThreadID =
         Thread.CurrentThread.ManagedThreadId.ToString();
     OperateContext context = null;
     if (this.m_contexts.ContainsKey(szThreadID))
         context = this.m_contexts[szThreadID];
     if (context != null)
         return context;
     context = new OperateContext(szThreadID
         , this.m_dbType, this.m_provider, this.m_connString);
     context.ClearPoolEnabled = this.m_bClearPoolEnabled;
     this.m_contexts.Add(szThreadID, context);
     return context;
 }