简体   繁体   中英

EF 6 - Error taking too long

When using the following connection string
Server=DoesNotExists; Database=DoesNotExistsEither; User ID=bla; Password=bla; Connection Timeout=5;
shouldn't any command against this connection string fail in 5 seconds?!? in my local machine it's taking about 30sec

Edit1
If i change the timeout to 20, it takes 1 min to fail...

Command timeout and connection timeout are not the same thing.

  • Connection timeout: maximum time to (try to) establish connection to database
  • Command timeout: maximum time a command is allowed to run

So in short: no, a command against that connectionstring should not fail after 5 seconds, if a connection is established.

See also this post.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM