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 you have large queries that hit this threshold in the PlanOptimizer (+370 columns and a number of tables, my query has nodecount=16885) the ObjectStateManager.AddEntityToCollectionOrReference may get a NullEntityWrapper in wrappedTarget parameter and this blows up in a NullReferenceException in GetOtherEndOfRelationship:
public RelationshipManager RelationshipManager
{
get
{
Debug.Fail("Cannot access RelationshipManager from null wrapper.");
return null;
}
}
When materializing objects in Shaper.MaterializeRow() the Coordinator for one (and only one) of the child collections in the Include(...) returns a NullEntityWrapper.
We have only seen this Exception when running EF Queries with AsNoTracking() against Oracle DB in our app, running the same queries without AsNoTracking() does not throw exception. And against SqlServer both with and without AsNoTracking() is working fine.
So is this most likely a bug in the Oracle.ManagedDataAccess.EntityFramework provider or a bug in EF 6 itself?
I used the same Query that previously failed with EF 6.4.4, Oracle.ManagedDataAccess v 19.10.0 and Oracle.ManagedDataAccess.EntityFramework v 19.7.0 and it was working fine now.
This could be a tricky one and may be located in Oracle.ManagedDataAccesss.EntityFramework
I've been digging into this issue this weekend and it surfaced by a this change in commit 2483303 "Query compilation performance" #430:
For my app I could workaround by adding this switch to the web.config/app.config
When you have large queries that hit this threshold in the PlanOptimizer (+370 columns and a number of tables, my query has nodecount=16885) the ObjectStateManager.AddEntityToCollectionOrReference may get a NullEntityWrapper in wrappedTarget parameter and this blows up in a NullReferenceException in GetOtherEndOfRelationship:
where a NullEntityWrapper returns
When materializing objects in Shaper.MaterializeRow() the Coordinator for one (and only one) of the child collections in the Include(...) returns a NullEntityWrapper.
We have only seen this Exception when running EF Queries with AsNoTracking() against Oracle DB in our app, running the same queries without AsNoTracking() does not throw exception. And against SqlServer both with and without AsNoTracking() is working fine.
So is this most likely a bug in the Oracle.ManagedDataAccess.EntityFramework provider or a bug in EF 6 itself?
@efeblesp for notification.
Originally posted by @jonnybee in #1408 (comment)
The text was updated successfully, but these errors were encountered: