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 6782421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:44:23+00:00 2026-05-26T16:44:23+00:00

I have to watch five calendars parallel if any notification appears. It works fine

  • 0

I have to watch five calendars parallel if any notification appears. It works fine but anytime after a few notifications or a period of time I got this Exception “The Watermark is invalid”.
I have a list of mailboxes which I want to watch ( only the Calendar Folder). The trigger starts every few seconds and the method look whether there is a notification or not.
If I create a few appointments and anytime the exception “The Watermark is invalid” was thrown. It appears in the Line where i get the Events.

 public Notification(ExchangeService _server1,  string[] _mailboxName1)
        {
            _server = _server1;
            _listOfList = _listOfList1;
            _mailboxName = _mailboxName1;
            foreach (Mailbox m in _mailboxName)
            {
                FolderId _Id = new FolderId(WellKnownFolderName.Calendar, m);
                PullSubscription pullSub = _server.SubscribeToPullNotifications(new FolderId[] { _Id }, 5, null, EventType.Copied, EventType.Created, EventType.Deleted, EventType.Modified, EventType.Moved);
                _subList.Add(pullSub);
            }
            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            AppSettingsReader config = new AppSettingsReader();
            int time = Convert.ToInt16(config.GetValue("TimerInterval", typeof(string)));
            aTimer.Interval = time;
            aTimer.Enabled = false;
            aTimer.Start();

        }
     private static void OnTimedEvent(object source, ElapsedEventArgs e)
    {
        Console.WriteLine("Timer");
        bool noteWatch = false;
        foreach (PullSubscription p in _subList)
        {
            string type = null;
            ItemId eventId = null;
            //Exception the watermark is invalid!! 
            GetEventsResults events = p.GetEvents();

            foreach (ItemEvent itemEvent in events.ItemEvents)
            {

                switch (itemEvent.EventType)
                {
                    case EventType.Created:
                        noteWatch = true;
                        eventId = itemEvent.ItemId;
                        type = "Created";
                        break;
                }
            }
        }
     }
  • 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-26T16:44:24+00:00Added an answer on May 26, 2026 at 4:44 pm

    I found the reason:
    My List of subscription was not thread safe.
    I added this to my code and it works fine:

    lock (_subList)
                    {
                         events = p.GetEvents();
                    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to run: sass --watch a.scss:a.css but have a.css end up
I have to watch for any input given to or any changes that made
Most debuggers have a watch function but I find it's kind of useless. I
I have a service that opens multiple watchers to watch multiple folders. After watching
I have a file watch directory named FileWatch C:\Users\MyFolder\FileWatch\Test The FileWatch folder is the
With python inotifyx, do I have to remove watch and close opened system file
I have been trying to add to the Watch window a Java Date object
I have a function that use setInterval() method to watch css propertie change('cause in
I have a daemon process written in Perl that uses Inotify2 to watch directories
I'd like to have my background page watch the URL and call chrome.tabs.executeScript on

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.