Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/SqlSessionStateProviderAsync/SqlSessionStateRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,13 @@ public async Task<SessionItem> GetSessionStateItemAsync(string id, bool exclusiv
{
using (var reader = await SqlSessionStateRepositoryUtil.SqlExecuteReaderWithRetryAsync(connection, cmd, CanRetryAsync))
{
if (await reader.ReadAsync())
// use the synchronous versions of Read and GetFieldValue because of performance issues with
// large data described here: https://github.com/dotnet/SqlClient/issues/593
if (reader.Read())
{
// Varbinary(max) should not be returned in an output parameter
// Read the returned dataset consisting of SessionItemLong if found
buf = await reader.GetFieldValueAsync<byte[]>(0);
buf = reader.GetFieldValue<byte[]>(0);
}
}

Expand Down