This commit is contained in:
28810
2019-02-25 10:12:33 +08:00
parent fb1871e558
commit 9d87c69fb2
12 changed files with 93 additions and 33 deletions

View File

@ -23,15 +23,17 @@ namespace FreeSql.Internal.CommonProvider {
public ObjectPool<DbConnection> MasterPool { get; protected set; }
public List<ObjectPool<DbConnection>> SlavePools { get; } = new List<ObjectPool<DbConnection>>();
public DataType DataType { get; }
protected ICache _cache { get; set; }
protected ILogger _log { get; set; }
protected int slaveUnavailables = 0;
private object slaveLock = new object();
private Random slaveRandom = new Random();
public AdoProvider(ICache cache, ILogger log) {
public AdoProvider(ICache cache, ILogger log, DataType dataType) {
this._cache = cache;
this._log = log;
this.DataType = dataType;
}
void LoggerException(ObjectPool<DbConnection> pool, DbCommand cmd, Exception e, DateTime dt, StringBuilder logtxt, bool isThrowException = true) {