You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using FutureValue in a TransactionScope, but only in async, a Specified method is not supported. error is receive. It needs to be atleast two queries since it fails when running them as a batch, if I turn the batch mode off it works again.
This only happens when using the Async methods (ToListAsync or ValueAsync) when using the sync methods it works.
I can run multiple Future() operations like this but as soon as I add one FutureValue the error is received. It also appears when having multiple FutureValue and no Future.
The produced SQL runs as it should, so it is only a problem with parsing the result.
2. Exception
Exception message:
Specified method is not supported.
Stack trace:
at System.Data.Common.DbConnection.EnlistTransaction(Transaction transaction)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.ConnectionEnlistTransaction(Transaction transaction)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.HandleAmbientTransactions()
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__21_0(DbContext _, Enumerator enumerator)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
at Z.EntityFramework.Plus.QueryFutureEnumerable`1.SetResult(IEnumerator`1 enumerator)
at Z.EntityFramework.Plus.QueryFutureEnumerable`1.SetResult(DbDataReader reader)
at Z.EntityFramework.Plus.QueryFutureBatch.<ExecuteQueriesAsync>d__14.MoveNext()
at Z.EntityFramework.Plus.QueryFutureValue`1.<ValueAsync>d__4.MoveNext()
at GR.Elevinformation.Library.DataAccess.QueryableExtensions.PaginatedListQueryableExtensions.<ToPaginatedListAsync>d__2`1.MoveNext() in C:\Users\Nordstrom\source\GR\Elevinformation.API\source\GR.Elevinformation.Library\DataAccess\QueryableExtensions\PaginatedListQueryableExtensions.cs:line 30
3. Fiddle or Project
usingvarscope=newTransactionScope(TransactionScopeAsyncFlowOption.Enabled);varfutureTotalCount=_dbContext.Users.DeferredCount().FutureValue();varfutureItems=_dbContext.Users.Future();varitems=awaitfutureItems.ToListAsync();//Throws here, if I change to ToList() it works
4. Any further technical details
Net 7
EF Core 7
Z.EntityFramework.Plus.EFCore 7.22.0
The text was updated successfully, but these errors were encountered:
1. Description
When using FutureValue in a TransactionScope, but only in async, a
Specified method is not supported.
error is receive. It needs to be atleast two queries since it fails when running them as a batch, if I turn the batch mode off it works again.This only happens when using the Async methods (ToListAsync or ValueAsync) when using the sync methods it works.
I can run multiple Future() operations like this but as soon as I add one FutureValue the error is received. It also appears when having multiple FutureValue and no Future.
The produced SQL runs as it should, so it is only a problem with parsing the result.
2. Exception
3. Fiddle or Project
4. Any further technical details
The text was updated successfully, but these errors were encountered: