Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3229168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:46:46+00:00 2026-05-17T16:46:46+00:00

So I have a very weird problem. I am writing some code in VB.Net

  • 0

So I have a very weird problem.

I am writing some code in VB.Net under .NET 2.0 which interfaces with MS Exchange 2003. Because of the Exchange 2003 “requirement” I am forced to write this code using WEBDAV.

The code itself is replicating, to some degree, a schedule management process. It’s creating Appointments on the Exchange Server in response to inputs from the user and managing it’s data internally in a SQL Server database.
The problem situation is this: A new person is assigned to be in charge of a meeting. The requirement says the program should generate a meeting cancellation request to the person removed from the meeting (if such a person existed) and a meeting request sent to the new person.

In the case of there being an existing person, what appears to happen is this:

  1. The meeting cancellation request
    gets sent
  2. Exchange barfs and returns status code 500 (internal server error) during the set of
    requests which send the meeting request to the new person.

However! While debugging this particular scenario, it works just fine for me, if I step through the code in the Visual Studio debugger. Left to it’s own devices, it fails every time.

Just for yuk’s sake, I added a Thread.Sleep(500) to the part after sending the cancellation request, and Exchange doesn’t barf anymore…

So, my question!

If adding a Thread.Sleep to the code causes this error to go away, a race condition is implied, no? But, my code is running under a web application and is a totally single threaded process, from start to finish. The web requests I am sending are all in synchronous mode so this shouldn’t be a problem.

What would I do next to try and track down the issue?

  • Try and divine if the race condition itself is in the .Net 2.0 BCL networking code?
  • Try and do some debugging on the Exchange server itself?
  • Ignore it, be glad the Thread.Sleep masks the problem and keep on going?

Any further suggestions would be wonderful.


In response to comment, I can post the failing function:

    Private Shared Sub UpdateMeeting(ByVal folder As String, ByVal meetingId As String, ByVal oldAssignedId As String, ByVal newAssignedTo As String, ByVal transaction As DbTransaction)
        If String.IsNullOrEmpty(meetingId) Then
            Throw New Exception("Outlook ID for that date and time is empty.")
        End If
        Dim x As New Collections.Generic.List(Of String)
        If oldAssignedId <> newAssignedTo AndAlso Not String.IsNullOrEmpty(oldAssignedId) Then
            'send cancellation to old person
            Dim lGetCounselorEmail1 As String = GetCounselorEmail(oldAssignedId, transaction)
            Common.Exchange.SendCancellation(meetingId, New String() {lGetCounselorEmail1})
            ' Something very weird here. Running this code through the debugger works fine. Running without causes exchange to return 500 - Internal Server Error.
            Threading.Thread.Sleep(500)
        End If
        x.Add(folder)
        If Not String.IsNullOrEmpty(newAssignedTo) Then x.Add(GetCounselorEmail(newAssignedTo, transaction))
        x.RemoveAll(AddressOf String.IsNullOrEmpty)
        If x.Count > 0 Then
            If Not Common.Exchange.UpdateMeetingAttendees(meetingId, x.ToArray()) Then
                Throw New Exception("Failure during update of calendar")
            End If
        End If
    End Sub

…but a lot of the implementation details are hidden here, as I wrote a set of classes to interface with Exchange WebDAV.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:46:46+00:00Added an answer on May 17, 2026 at 4:46 pm

    Ended up sticking with the Sleep and calling it a day.

    My ‘belief’ is that I was erroneous in thinking that a WebRequest/WebResponse combo sent to Exchange through WebDav was an atomic operation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen some very weird for loops when reading other people's code. I
I have a very strange problem. Under some elusive circumstances I fail to apply
I have a very weird problem. I am using PHP, in my PHP code,
I have a very weird problem: sometimes when I call nHibernate update to an
I have a very simple problem which requires a very quick and simple solution
I have a very weird problem.. I really do hope someone has an answer
I have a very weird problem in Firefox ( version 3.5.2), and I am
I have a very weird problem, when storing my session in Memcached. From time
I have a very weird problem with resx based localization. At first, let me
I have a very weird problem. Have an application using Hibernate and spring.I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.