سؤال

I've an application developed in winforms(.net) and it is using Sql Server database.
My client would be using the application locally (intranet) and some of my client would be using the same application from remote location (winform application in on region and database server far in another region).

Now the problem is when they are using my application from remote location, sometimes i get command timeout.
For now I've increased the commandtimeout in my code which is running fine. But I wanna know is it a best practice to increase command timeout in situations like this?
Command timeout also includes the reading/writing of data in the network channel too no? (atleast this is what i've found on msdn) so if database is on far location, is it wise to increase command and connection timeout?

هل كانت مفيدة؟

المحلول

Sounds like you really need another layer in your application, so the clients talk to a Data/Business logic layer which then gets the data from SQL on behalf of the client.

This way, your client only has to deal with network latency and not SQL Command timeouts. You also no longer have to expose your SQL server to logins which are coming directly from a machine across the Internet, it can be configured to only allows logins from your Data Layer which is in the same physical location as the SQL box.

You can then investigate the latency problem without involving SQL.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top