简体   繁体   中英

Execute package in ssis causes Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

I have this code

    var connection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["SSIS"].ConnectionString);
            var integrationServices = new IntegrationServices(connection);

            var package = integrationServices
                .Catalogs["SSISDB"]
                .Folders["MYFOLDER"]
                .Projects["MYPROJECT"]
                .Packages["MYPACKAGE.dtsx"];

            var executionParameters = new System.Collections.ObjectModel.Collection<Microsoft.SqlServer.Management.IntegrationServices.PackageInfo.ExecutionValueParameterSet>();
            var executionParameter = new Microsoft.SqlServer.Management.IntegrationServices.PackageInfo.ExecutionValueParameterSet();
            executionParameter.ObjectType = 50;
            executionParameter.ParameterName = "SYNCHRONIZED";
            executionParameter.ParameterValue = 1;
            executionParameters.Add(executionParameter);

            long executionIdentifier = package.Execute(true, null, executionParameters);

As soon as I call package.Execute, it causes the error Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

I already adjusted the timeouts here but error exist.

If I remove the parameter executionParameter.ParameterName = "SYNCHRONIZED", problem is removed. but I would like to do the call to execute synchronously.

Any idea how to fix this? Thanks

It seems like there is a 30 seconds timeout on executing packages which you cannot override. You may need to overcome this limitation by executing the package asynchronously and then waiting for it to complete. See below

ExecutionOperation operation = ssisServer.Catalogs["SSISDB"].Executions[executionIdentifier];

while (!operation.Completed))
{
  operation.Refresh();

  // Wait before refreshing again
  System.Threading.Thread.Sleep(500);
}

See this link for more details

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.

Related Question SQL Server Exception:Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding ExecuteQueryin linq :Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding Linq Count() timing out -Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. working on remote windows .net Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding C# entityframework core throwing Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding 'Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM