moneycollector
moneycollector
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
aight sounds good, will check it later on. for now i have a 1% unstable connectionpool bothering users hehe
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
what do you advice mr SB?
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
i could test that but pretty sure it cant be null as prelim code would already crash on that point
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
you are right, that first await can be ditched. using var will be enough.
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
myeah something like that would be it.. But can't see it as nowhere are signs of that for the rest. All other APIs / calls programs / connections etc are just fine. It looks like the system gets confused, especially with often hitting the second error that it expected more packets ( MySqlConnector.MySqlProtocolException: Packet received out-of-order. Expected 1; got 2 ) So it expects results on 1 query but gets another result, it seems.
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
therefor i tried to use the dependency injection, but no improvement. Besides that, the MySqlConnector keeps a pool of connections available anyway and re-uses that with the OpenConnection command.. So it also doesn't make sense there i think
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
long
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
aha i see, new for me 🙂 thanks
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
{
await using var conn = await dbBroadcast.OpenConnectionAsync();
string qChannelsToScan = "SELECT channel_id FROM channels_members WHERE member_id = @my_id";
using var cmdChannelsToScan = new MySqlCommand(qChannelsToScan, conn);
cmdChannelsToScan.Parameters.AddWithValue("my_id", internal_id);
using var rdrChannelsToScan = await cmdChannelsToScan.ExecuteReaderAsync(); // Here is the NullException thrown
}
{
await using var conn = await dbBroadcast.OpenConnectionAsync();
string qChannelsToScan = "SELECT channel_id FROM channels_members WHERE member_id = @my_id";
using var cmdChannelsToScan = new MySqlCommand(qChannelsToScan, conn);
cmdChannelsToScan.Parameters.AddWithValue("my_id", internal_id);
using var rdrChannelsToScan = await cmdChannelsToScan.ExecuteReaderAsync(); // Here is the NullException thrown
}
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
In most cases, after this primary error, i got MySqlConnector.MySqlProtocolException: Packet received out-of-order. Expected 1; got 2. either which took my thinking it has a connectionpool problem. Unfortunately it didn't solve the case.
27 replies
CC#
Created by moneycollector on 12/31/2023 in #help
Sometimes: Object Null Exception when using var rdr = await cmd.ExecuteReaderAsync();
This happens in around 1% of the cases. I hoped to use a MySQLDataSource dependency injection would help, but it did not.
27 replies