public DBManagerPool GetReadDbByTableName(string tableName) { DBManagerPool db = null; ReadTableList.TryGetValue(tableName, out db); return(db); }
public DBManagerPool GetDbByLableName(string labelName) { DBManagerPool db = null; DBLabelNameList.TryGetValue(labelName, out db); return(db); }
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); }
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; } }
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); }
public void AddNameDB(string labelName, DBManagerPool db) { DBLabelNameList.Add(labelName, db); }