Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySQL 8.3 Nuget Assemblies (no replies)

$
0
0
After updating from MySQL 8.2 to 8.3, I updated the MySql.Data, MySql.Data.EntityFramework, and MySql.Web to 8.3.

Using the MySqlSessionStateStore.cs, an error appeared in the following section:

Unable to cast object of type 'System.Byte[]' to type 'System.String' under the following line of code:

Line 417: serializedItems = reader.GetString(1);

This error went away when 8.2 drivers were reloaded. No coding was changed on the app.

The code is used to change the MySqlSesssionStateStore since autocommit is turned off on the server.

The full code is found on kimple.com.


// Retrieve session item data from the data source.
reader = cmd.ExecuteReader(CommandBehavior.SingleRow);
while (reader.Read())
{
expires = reader.GetDateTime(0);

if (expires < DateTime.Now)
{
// The record was expired. Mark it as not locked.
locked = false;
// The session was expired. Mark the data for deletion.
deleteData = true;
}
else
foundRecord = true;

serializedItems = reader.GetString(1);
lockId = reader.GetInt32(2);
lockAge = DateTime.Now.Subtract(reader.GetDateTime(3));
actionFlags = (SessionStateActions)reader.GetInt32(4);
timeout = reader.GetInt32(5);
}
reader.Close();

Viewing all articles
Browse latest Browse all 1451

Trending Articles