-
Couldn't load subscription status.
- Fork 347
-
- What is the proper code usage to benefit from connection reuse ? Perhaps creating unit test ?
- There seems to be an issue with charset statements because quite often 2 queries are being sent to the server:
2025年03月12日T15:35:34.088403+02:00 1957 Connect test@localhost on performance_mon using SSL/TLS
2025年03月12日T15:35:34.089155+02:00 1957 Query SET NAMES utf8mb4
2025年03月12日T15:35:34.097924+02:00 1957 Query SET NAMES utf8mb4
I am seeing multiple "Connect" events in the MySQL general log even if using the following config:
ConnectionLifeTime=0;Min Pool Size=0;Max Pool Size=100;Pooling=true
This approach does not create new "Connect" event:
using (MySqlConnection connection = new MySqlConnection(_connectionString))
{
await connection.OpenAsync();
// do whatever needed
}
But this approach will create "Connect" event each time:
_dataSource = new MySqlDataSourceBuilder(_connectionString).
UseLoggerFactory(_logger)
.Build();
using (MySqlConnection connection = await _dataSource.OpenConnectionAsync())
{
// do whatever needed
}
2025年03月12日T15:35:38.653244+02:00 1967 Connect test@localhost on performance_mon using SSL/TLS
2025年03月12日T15:35:38.653715+02:00 1967 Query SET NAMES utf8mb4
2025年03月12日T15:35:38.658850+02:00 1967 Query SET NAMES utf8mb4
2025年03月12日T15:35:38.667228+02:00 1967 Query INSERT INTO foo SET `field` = 0
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
Any comments ? @bgrainger
Beta Was this translation helpful? Give feedback.
All reactions
-
I would need a self-contained repro of the problem in order to comment accurately on this issue.
Beta Was this translation helpful? Give feedback.
All reactions
-
If you enable "Trace"-level logging and upload a full log file, that may provide enough information to diagnose the issue. (MySqlConnector will log all statements it sends.)
Beta Was this translation helpful? Give feedback.
All reactions
-
It may take me some time to provide self-contained example. Standard examples work fine...
Beta Was this translation helpful? Give feedback.