From 1b7c578544038ab8d7f7705f17c50afcb459f73f Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Mon, 28 Aug 2023 23:16:06 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=8F=96=E6=B6=88=20Sqlite=20=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=BD=BF=E7=94=A8=20AdoPool=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/FreeSqlBuilder.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/FreeSql/FreeSqlBuilder.cs b/FreeSql/FreeSqlBuilder.cs index 33a5dfe5..e14cf192 100644 --- a/FreeSql/FreeSqlBuilder.cs +++ b/FreeSql/FreeSqlBuilder.cs @@ -28,7 +28,7 @@ namespace FreeSql bool _isLazyLoading = false; bool _isExitAutoDisposePool = true; bool _isQuoteSqlName = true; - bool? _isAdoConnectionPool = null; + bool _isAdoConnectionPool = false; MappingPriorityType[] _mappingPriorityTypes; NameConvertType _nameConvertType = NameConvertType.None; Action _aopCommandExecuting = null; @@ -374,13 +374,9 @@ namespace FreeSql default: throw new Exception(CoreStrings.NotSpecified_UseConnectionString_UseConnectionFactory); } } - var isAdoPool = false; - if (_isAdoConnectionPool != null) isAdoPool = _isAdoConnectionPool.Value; - else if (_dataType == DataType.Sqlite) isAdoPool = true; //sqlite 默认使用 Ado Pool - else isAdoPool = false; ret = Activator.CreateInstance(type, new object[] { - isAdoPool ? $"AdoConnectionPool,{_masterConnectionString}" : _masterConnectionString, + _isAdoConnectionPool ? $"AdoConnectionPool,{_masterConnectionString}" : _masterConnectionString, _slaveConnectionString, _connectionFactory }) as IFreeSql;