mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update QuestDb BUG
This commit is contained in:
parent
2610a76519
commit
0e0bed3428
@ -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;
|
||||
|
@ -36,7 +36,7 @@ namespace SqlSugar
|
||||
base._DbConnection = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void BeginTran(string transactionName)
|
||||
{
|
||||
base.BeginTran();
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user