I am pulling data from Snowflake into my .NET MVC 3.1 application using Snowflake .NET connector(Snowflake.Data) and running into an issue as below:
The issue occurs only when there is no call from app to Snowflake for more than 4 hours.
"Session no longer exists. New login required to access the service. SqlState: , VendorCode: 390111"
I understand this can be fixed by setting CLIENT_SESSION_KEEP_ALIVE=True which I guess is not supported by .NET ? Is there any workaround?
public async Task<List<PO>> FetchPO(string plant)
{
using IDbConnection dbConnection = new SnowflakeDbConnection();
dbConnection.ConnectionString = _configuration.GetConnectionString(Constants.ConnectionStrings.SnowflakeConnectionString);
List<PO> po= (await dbConnection.QueryAsync<PO>($"select * from {Constants.Snowflake.Views.PO} ")).ToList();
return po;
}