예제 #1
0
        public DBManagerPool GetReadDbByTableName(string tableName)
        {
            DBManagerPool db = null;

            ReadTableList.TryGetValue(tableName, out db);
            return(db);
        }
예제 #2
0
        public DBManagerPool GetDbByLableName(string labelName)
        {
            DBManagerPool db = null;

            DBLabelNameList.TryGetValue(labelName, out db);
            return(db);
        }
예제 #3
0
        public void Call(AbstractDBQuery query, int index, string tableName = DBProxyDefault.DefaultTableName, DBOperateType type = DBProxyDefault.DefaultOperateType, DBCallback callback = null)
        {
            DBManagerPool dbPool = GetDbByTable(tableName, type);

            if (dbPool == null)
            {
                LOG.Warn("db call {0} failed:can not find table{1} type {2} db", query.GetCmd(), tableName, type.ToString());
                return;
            }
            dbPool.Call(query, index, callback);
        }
예제 #4
0
        public void AddTableDB(string tableName, DBManagerPool db, DBOperateType operateType)
        {
            switch (operateType)
            {
            case DBOperateType.Write:
                WriteTableList.Add(tableName, db);
                break;

            case DBOperateType.Read:
                ReadTableList.Add(tableName, db);
                break;

            default:
                LOG.Error("add table db falied:got invalid opetate type {0}", operateType);
                break;
            }
        }
예제 #5
0
        public DBManagerPool GetDbByTable(string tableName, DBOperateType type)
        {
            DBManagerPool db = null;

            switch (type)
            {
            case DBOperateType.Write:
                WriteTableList.TryGetValue(tableName, out db);
                break;

            case DBOperateType.Read:
                ReadTableList.TryGetValue(tableName, out db);
                break;

            default:
                break;
            }
            return(db);
        }
예제 #6
0
 public void AddNameDB(string labelName, DBManagerPool db)
 {
     DBLabelNameList.Add(labelName, db);
 }