locked
DirectoryEntry.CommitChanges() block my Windows Service RRS feed

  • Question

  • Hi All,

    I'm writing a Windows Service process that blocks during the CommitChanges operation:

            DirectoryEntry ent = new DirectoryEntry( bindString );
            ent.Properties["member"].Add(newMember);
            ent.CommitChanges();

    This issue does not occur every time, the Windows Service performs this operation several times and sometimes the process blocks, i have to restart the Windows Service to continue the process.

    I have a dump of my process that has the following output:

    This thread is waiting on data to be returned from another server via WinSock.

    With this kind of output, what could be the block cause?

    Another question, is there any workarround for this situation? Could i have a timeout for a CommitChanges operation? I just want to force the process to continue.

    Best Regards,

    Rodrigo Guerreiro



    Thursday, March 6, 2014 10:02 PM

All replies

  • Hi Rodrigo,

    I am trying to involve someone familiar with this issue to come into this thread. Thank you for your understanding.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 7, 2014 2:00 AM
  • Hi Rodrigo,

    Sorry for delay. But the information is not enough for troubleshooting. The information on the picture says the thread has evidence of .net exceptions on stack. You should find it and post here.

    > Another question, is there any workarround for this situation? Could i have a timeout for a CommitChanges operation? I just want to force the process to continue.

    Try to add try-catch block to ent.CommitChanges method.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 18, 2014 5:54 AM
  • Hi Herro,

    Thanks for your feedback.

    The other evidences of .net exceptions on stack, doesn't has relation with this the evidence on the picture.

    Regarding the workarround, i already have a try-catch block that does not solve the problem becouse the service just hangs on the CommitChanges call and no exception is raised.

    My service hangs becouse is waiting for data for another server. Is there any possibility to add a timeout to a CommitChanges call? If you have any idea for other workarrounds i'll apreciate.

    Thanks in advance.

    Best Regards,

    Rodrigo Guerreiro

    Friday, March 21, 2014 2:19 PM
  • Hi Rodrigo,

    There is no timeout option for DirectoryEntry directly. Do your directory operation on a new thread or BackgroundWorker and control your own timeout.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 25, 2014 8:33 AM