Update QuestDb BUG

This commit is contained in:
sunkaixuan
2022-09-09 21:26:34 +08:00
parent 2610a76519
commit 0e0bed3428
2 changed files with 62 additions and 1 deletions

View File

@@ -71,6 +71,36 @@ namespace SqlSugar
CheckConnection();
return sqlCommand;
}
/// <summary>
/// Check connection
/// </summary>
public override void CheckConnection()
{
if (this.Connection.State != ConnectionState.Open)
{
try
{
int i = 0;
while (i < 10)
{
try
{
//QuestDb loss problem
this.Connection.Open();
break;
}
catch
{
i++;
}
}
}
catch (Exception ex)
{
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
}
}
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((NpgsqlDataAdapter)dataAdapter).SelectCommand = (NpgsqlCommand)command;

View File

@@ -71,6 +71,37 @@ namespace SqlSugar
CheckConnection();
return sqlCommand;
}
/// <summary>
/// Check connection
/// </summary>
public override void CheckConnection()
{
if (this.Connection.State != ConnectionState.Open)
{
try
{
int i = 0;
while (i < 10)
{
try
{
//QuestDb loss problem
this.Connection.Open();
break;
}
catch
{
i++;
}
}
}
catch (Exception ex)
{
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
}
}
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((NpgsqlDataAdapter)dataAdapter).SelectCommand = (NpgsqlCommand)command;