how can I increase Timeout (or set to 0)?
bgraves
Posts: 19
I'm using the the ExecuteBlock class to replicate data from one server to the other. How can I set whatever SQLCommand.Timeout that this class is using. Currently, I'm timing out after 2 hours.
Comments
CommandTimeouts are not configurable in ADO .NET, except in the code. So the ExecuteBlock method has a hard-coded timeout of ten minutes.
If you need to specify your own commandtimeout, you can write your own block executor and set the commandtimeout property of the SqlCommand to whatever you want.
There is an example of this on the Red Gate knowledge base. It doesn't show setting the command timeout, but it does show how to run your own execution block. You can then set the commandtimeout property on the SqlCommand object.
Also, in the past week I've notice the the replication time (when not timing out) has increased significantly. Our set of tables replicated in under 11 minutes last week. Currently, it's taking 20-25 minutes on a regular basis. Is there a reason this is happening (even when no new rows are being added to the table)? This is very difficult to troubleshoot since the code is hidden in the redgate DLLs. Could upgrading the libraries help (currently we're using version 6...not 8)? I'm afraid to upgrade them now if the timeout has been decreased to 10 minutes.