I am using C# to execute a package within SSISDB and found a post discussing the API as well as how to force synchronous execution of the package. However, when calling Validate() on the Package info there is not an overload to take the previously mentioned parameter that forces synchronous execution. The result appears to be that the validation executes asynchronously and I have not seen a way in the API to wait for the result. I tried looking at the ValidationOperation.Status as shown in my code below but the Status stays at "running" long after the Validation is complete. I was hoping for an Event that I could subscribe to to detect validation completion.What is the proper way to do this?
// Validate the Package long validationIdentifier = ssisPackageInfo.Validate(use32bitRuntime, IS.PackageInfo.ReferenceUsage.SpecifyReference, envReference); // // Validation is asynchronous so we have to wait for it to finish // IS.ValidationOperation validationOperation; do { System.Threading.Thread.Sleep(500); validationOperation = catalog.Validations[validationIdentifier]; } while(validationOperation.Status == Operation.ServerOperationStatus.Created || validationOperation.Status == Operation.ServerOperationStatus.Pending || validationOperation.Status == Operation.ServerOperationStatus.Running || validationOperation.Status == Operation.ServerOperationStatus.Stopping);
I also am trying to determine if a Validation was successful, in the past we would get a DTExecResult enum back from the call to Execute() that we could use to check if it was Successful, Failed, Canceled, etc...