From 668b5e580dcbbf2d83ed310c46de5af99fe14145 Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Mon, 20 Jan 2020 02:08:51 +0800 Subject: [PATCH] debug #183 --- .../FreeSql.Provider.Sqlite/SqliteAdo/SqliteAdo.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteAdo.cs b/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteAdo.cs index 5745a3e8..5e44f876 100644 --- a/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteAdo.cs +++ b/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteAdo.cs @@ -19,10 +19,8 @@ namespace FreeSql.Sqlite if (connectionFactory != null) { MasterPool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.Sqlite, connectionFactory); - using (var conn = MasterPool.Get()) - { - _CreateCommandConnection = conn.Value; - } + _CreateCommandConnection = MasterPool.Get().Value; + _CreateCommandConnection.Close(); return; } if (!string.IsNullOrEmpty(masterConnectionString)) @@ -65,7 +63,12 @@ namespace FreeSql.Sqlite DbConnection _CreateCommandConnection; protected override DbCommand CreateCommand() { - if (_CreateCommandConnection != null) return _CreateCommandConnection.CreateCommand(); + if (_CreateCommandConnection != null) + { + var cmd = _CreateCommandConnection.CreateCommand(); + cmd.Connection = null; + return cmd; + } return new SQLiteCommand(); }