This commit is contained in:
28810 2020-01-20 02:08:51 +08:00
parent c89e4f9b20
commit 668b5e580d

View File

@ -19,10 +19,8 @@ namespace FreeSql.Sqlite
if (connectionFactory != null) if (connectionFactory != null)
{ {
MasterPool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.Sqlite, connectionFactory); MasterPool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.Sqlite, connectionFactory);
using (var conn = MasterPool.Get()) _CreateCommandConnection = MasterPool.Get().Value;
{ _CreateCommandConnection.Close();
_CreateCommandConnection = conn.Value;
}
return; return;
} }
if (!string.IsNullOrEmpty(masterConnectionString)) if (!string.IsNullOrEmpty(masterConnectionString))
@ -65,7 +63,12 @@ namespace FreeSql.Sqlite
DbConnection _CreateCommandConnection; DbConnection _CreateCommandConnection;
protected override DbCommand CreateCommand() 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(); return new SQLiteCommand();
} }