語言

DbQueryConcurrencyException Class

Definition

An exception that is thrown when a query which loads related collections using SplitQuery cannot correlate the parent and child rows because the data was modified concurrently while the query was executing.

[System.Runtime.CompilerServices.Nullable(0)]
[System.Serializable]
public class DbQueryConcurrencyException : Exception
[<System.Runtime.CompilerServices.Nullable(0)>]
[<System.Serializable>]
type DbQueryConcurrencyException = class
    inherit Exception
Public Class DbQueryConcurrencyException
Inherits Exception
Inheritance
DbQueryConcurrencyException
Attributes

Remarks

Split queries execute multiple SQL statements, and the results can become inconsistent when the underlying data is modified between those statements. When Entity Framework detects that it can no longer reliably correlate the parent and child rows, it throws this exception instead of returning incorrect results.

The recommended way to handle this exception is to catch it and execute the query again, ideally within a serializable or snapshot transaction to prevent the concurrent modification from recurring.

See Split queries for more information and examples.

Constructors

Name Description
DbQueryConcurrencyException()

Initializes a new instance of the DbQueryConcurrencyException class.

DbQueryConcurrencyException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the DbQueryConcurrencyException class from a serialized form.

DbQueryConcurrencyException(String, Exception)

Initializes a new instance of the DbQueryConcurrencyException class.

DbQueryConcurrencyException(String)

Initializes a new instance of the DbQueryConcurrencyException class.

Applies to