Closed dharmenbavaria closed 1 year ago
Add this to your connection string.
insecuremode=true
Has there been any movement on or confirmation of this bug? We are experiencing the same issue, but always after one succesful query...
using var conn = new SnowflakeDbConnection(connectionString);
using var cmd = conn.CreateCommand();
cmd.CommandText = $"<query>";
conn.Open();
using var reader = cmd.ExecuteReader();
if (reader.Read()) {
return reader.GetValue();
}
return null;
hello and thank you for raising this issue, also apologies for the long period without response. we'll take a look
this issue seems to be related to some connection pool errors which were there indeed with earlier driver versions like 2.0.17 but in the latest one 2.0.25 this should be fixed. Please upgrade to the latest driver and retest - let us know if you still see the same error. Probably we'll require you to share the debug logs with the reproduction as well.
This is still happening with the Snowflake.Data nuget package 2.1.3.
since we couldn't reproduce it even with 2.0.25 (after all the connection pool fixes), if the issue still occurs for you guys, can someone who still has this issue with the latest Snowflake driver please open a new issue in this repo with a reproducible code example ? Thank you in advance !
Issue description
We are getting this error on production code with the exception message "Can't execute a command when the connection has never been opened", I have no clue why the SFSession state is null.
Situation We have a different repository for create, update and delete, and for every method execution, we create a connection execute the query and close the connection.
Locally we never have this issue only in production code.
Example code
Error log
There is an example in READMD.md file showing you how to enable logging.
Configuration
Driver version: 2.17.0 Dotnet framework and version: E.g. .net framework 4.5.2 or .net standard 2.0 .net 6.0 Server version: 7.2.0
Client OS: Linux container mcr.microsoft.com/dotnet/aspnet:6.0