none
Monitoring a stop runstep signal in ECMA 2.0 RRS feed

  • Question

  • HI Guys

    I have written an ECMA 2.0 management agent connecting to powershell. Everything works well except that I have to wait for the current resultset to finish on import before stopping the MA import run which in my case is 300k objects taking more than two hours to complete. Is there a way to monitor when the stop is called from the console so that I can terminate the current call. I have implemented a timer that can achieve this).

    Thans in advance


    Visit My Blog: http://theidentityguy.blogspot.com/

    Wednesday, September 12, 2012 1:20 AM

Answers

  • Update....

    I would like to be able to terminate my import when the runstep is cancelled from the Sync Engine Console. Unfortunately the powershell thread process will wait for my resultant set of data to finish downloading (prior to doing a paged import into the connector space) and the powershell.invoke() thread does not release control back until it is completed. If I am unable to get this working using a synchronous call I will probably end up having to do the call asynchronously and calling an endinvoke without a IASyncResult. What I was trying to establish if there was a method to get a status from the ECMA when the actual run step was cancelled to end the powershell.invoke() thread. I know that the ECMA process is called as part of the InvokeBeginImportWorker call, but this is not visible to the ECMA class, but I was hoping to have this bit of magic to make sure that I could do it during a synchronous run.


    Visit My Blog: http://theidentityguy.blogspot.com/

    • Marked as answer by Jssting Friday, September 28, 2012 1:30 AM
    Friday, September 14, 2012 1:57 AM

All replies

  • Generally the best solution is to make sure the ECMA2 agent processes the import in "pages" of a manageable size (say, a few hundred at a time); you'll notice one of the constructors for GetImportEntriesResults accepts a "hasMore" flag.

    If you have one very large, non-interruptible, blocking import call, it might make sense to generate it outside of the ECMA and stash the results in SQL or the like periodically.

    Wednesday, September 12, 2012 3:59 PM
  • Hi Steve,

    I have paging implemented to process the resultset. Unfortunately the powershell interface does not support paging import or doing filtering of the resultset so I need a way to interupt the import of the resultset when the process is cancelled from the sync servie console. It stops fine while paging, but not during the process of importing the resultset as a psobject collection.


    Visit My Blog: http://theidentityguy.blogspot.com/

    Wednesday, September 12, 2012 11:21 PM
  • Update....

    I would like to be able to terminate my import when the runstep is cancelled from the Sync Engine Console. Unfortunately the powershell thread process will wait for my resultant set of data to finish downloading (prior to doing a paged import into the connector space) and the powershell.invoke() thread does not release control back until it is completed. If I am unable to get this working using a synchronous call I will probably end up having to do the call asynchronously and calling an endinvoke without a IASyncResult. What I was trying to establish if there was a method to get a status from the ECMA when the actual run step was cancelled to end the powershell.invoke() thread. I know that the ECMA process is called as part of the InvokeBeginImportWorker call, but this is not visible to the ECMA class, but I was hoping to have this bit of magic to make sure that I could do it during a synchronous run.


    Visit My Blog: http://theidentityguy.blogspot.com/

    • Marked as answer by Jssting Friday, September 28, 2012 1:30 AM
    Friday, September 14, 2012 1:57 AM