c# - Postgresql NpgSql connection handling extra query and multiple close connection -


i running sql query through dapper when profiling on over every query perform npg sql see executescalar query sent on connection. , there multiple npgsqlconnection.close events. run query in using statement terminates npgsqlconnection follow.

        using (var connection = new npgsqlconnection(connectionstring))         {             return connection.queryasync<t>(sql, param);         } 

the runs command 1 every sql send through code -

set extra_float_digits = 3 set ssl_renegotiation_limit = 0 set lc_monetary = 'c' select 'npgsql73113' 

here profiler screenshot of relevant section. 1 know why there query , multiple connection close events.

enter image description here

you using npgsql 2.2, old , sent these commands on startup. please upgrade latest stable version (3.1.3) , these should gone.

i'm less sure connection close events, if see behavior in 3.1.3 please report issue.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo