簡體   English   中英

在sis中執行軟件包會導致超時過期。 操作完成之前經過的超時時間或服務器未響應

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

我有這個代碼

    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);

我一調用package.Execute,就會導致錯誤超時過期。 操作完成之前經過的超時時間或服務器未響應

我已經在這里調整了超時時間但是存在錯誤。

如果刪除參數executionParameter.ParameterName =“ SYNCHRONIZED”,則會解決問題。 但我想進行調用以同步執行。

任何想法如何解決這個問題? 謝謝

似乎執行程序包有30秒超時,您無法覆蓋它。 您可能需要通過異步執行程序包然后等待其完成來克服此限制。 見下文

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

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

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

請參閱此鏈接以獲取更多詳細信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM