/// <summary> /// 数据库访问池实例化 /// </summary> /// <param name="poolFlag">数据库访问池标记</param> /// <param name="logger">日志接口</param> /// <param name="vistor">数据库访问池客户,用于进行处理结果和日志的操作</param> /// <param name="sqlLogPool">数据库日志池对象,这是个全局静态对象,用于向日志库记录对数据库的操作,如果不需要可以为null</param> public DbAccessPool(int poolFlag, IGsLogger logger, DbAccessPoolVistor vistor, DbAccessPool sqlLogPool) { _poolFlag = poolFlag; _logger = logger; _vistor = vistor; _sqlLogPool = sqlLogPool; }
/// <summary> /// 添加一个数据库访问池 /// </summary> /// <param name="dbp">数据库访问池对象</param> public static void AddPool(DbAccessPool dbp) { if (_poolList.ContainsKey(dbp.Flag)) { _poolList[dbp.Flag] = dbp; } else { _poolList.Add(dbp.Flag, dbp); } }