Book a Demo

Author Topic: Endless EA_OnNotifyContextItemModified method call  (Read 3741 times)

Stanislaw Tristan

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Endless EA_OnNotifyContextItemModified method call
« on: October 16, 2014, 08:02:59 pm »
Hello!
this code on C# runs uncontrolled multiple times:
 
Code: [Select]
public void EA_OnNotifyContextItemModified(Repository repository, string GUID, ObjectType ot)
            {
                var element = repository.GetElementByGuid(GUID);
                element.Alias="Alias";
                element.Update; ///this process endless cycle
            }
How to avoid recurrence?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Endless EA_OnNotifyContextItemModified method
« Reply #1 on: October 16, 2014, 08:08:58 pm »
Maybe by setting a lock before the Update  and releasing it afterwards?

q.

Stanislaw Tristan

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Endless EA_OnNotifyContextItemModified method
« Reply #2 on: October 16, 2014, 08:13:58 pm »
Thanks for quick answer!
« Last Edit: October 16, 2014, 08:31:30 pm by stristan »