The SQL Server View comes with cache effects ?!

Source: Internet
Author: User

Condition:

1. Entity Framework Code First

2. The same context (or a transaction)

3. Use MSSQL

 

First, query a view, update the table associated with the composition view, and then query the view with the same conditions. No updated data is obtained.

If you place the same query conditions in another context, you can obtain the updated data.

If the conditions change, for example, from Name = 'A' programming Name = 'B', you can obtain the updated data.

 

Probably as follows:

Using (Context c)

{

C. View. Where (e => e. Name. Equals (""));

C. Table. Update (); // View is composed of a Table and another Table.

C. view. where (e => e. name. equals ("A"); // The data is actually updated, but not the updated data. If you change A to B, you can get the data.

// In addition, I have observed SQL statements through SQL Profile. Everything is normal. Three SQL statements are executed in the database.

}

 

At present, I have not studied this problem in depth. I don't know whether it is a database problem, An ADO problem, or an EF problem.

 

Annoying !!!!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.