Пример #1
0
 internal bool OpenCon()
 {
     bool result = OpenCon(connObject.Master);
     if (_IsAllowRecordSql)
     {
         connObject.SetNotAllowSlave();
         isAllowResetConn = false;
     }
     return result;
 }
Пример #2
0
        /// <summary>
        /// 打开链接只切主备
        /// </summary>
        /// <returns></returns>
        internal bool OpenCon()
        {
            ConnBean master = connObject.Master;

            if (!master.IsOK && connObject.BackUp != null && connObject.BackUp.IsOK)
            {
                master = connObject.BackUp;
                connObject.InterChange();//主从换位置
            }
            if (master.IsOK || (connObject.BackUp != null && connObject.BackUp.IsOK))
            {
                bool result = OpenCon(master, AllowConnLevel.MasterBackup);
                if (result && _IsAllowRecordSql)
                {
                    connObject.SetNotAllowSlave();
                    isAllowResetConn = false;
                }
                return(result);
            }
            return(false);
        }