This commit is contained in:
28810
2019-12-17 01:52:56 +08:00
parent e1e3e4a3b2
commit 301578936a
18 changed files with 151 additions and 24 deletions

View File

@ -54,8 +54,11 @@ namespace FreeSql.Internal.CommonProvider
public void Return(Object<DbConnection> obj, bool isReset = false)
{
if (obj == null) return;
Policy.OnDestroy(obj.Value);
if (obj == null || obj.Value == null) return;
if (obj.Value.State != ConnectionState.Closed)
obj.Value.Close();
if (_dataType == DataType.Sqlite)
obj.Dispose();
}
public bool SetUnavailable(Exception exception)