Entity Framework - Simple query takes 3 minutes to complete

devart entity-framework-6 oracle

Question

I'm using Entity Framework 6 Code First with an Oracle database (using Devart DotConnect for Oracle)

With a specific query with a SingleOrDefault, the query takes 1 second to complete :

-- Executing at 08.10.2019 10:04:04 +02:00
-- Completed in 1211 ms with result: d

But then, nothing happen during 3,5 minutes, until the connection is closed :

Closed connection at 08.10.2019 10:07:41 +02:00

During this time, the CPU of the database server goes up to 100%.

If I execute the same query directly on the database, it is very fast.

if I slightly modify my LINQ query, it is also very fast.

Do you have an idea what I can try to find the source of the problem and why there is a difference between executing the query directly or from Entity Framework ?

1
0
10/8/2019 8:27:05 AM

Popular Answer

  1. Enable dbMonitor and specify SQL generated by EF provider.

  2. Check the Parameters window in dbMonitor and make sure that the datatypes of parameters used in WHERE condition are the same as the datatypes of the corresponding columns.

  3. Tell us the version and edition of your Oracle Server.

1
10/8/2019 6:48:23 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow