hi,
I have a plugin which is registered with several steps on multiple entities.
My entities (renamed to keep it simple) are: "A" 1:n "B" 1:n "C"
the plugin is registered for updates in "A", "B" and "C" and also registered for create in "B" and "C".
so everytime someone changed anything inside the records of "A","B" or "C" the plugin gets executed.
this is no problem when I edit records over the web-form f.e.
But when I use the bulkedit-funktion to change a value in multiple-records about 50% or more of the records failed to update because of a "generic SQL error".
This error occurs inside the plugin when it tries to update the entity above or even try to get records over the webservice ( I guess It can appear in every use of the webservies)...
So my question is: Is there a way to lock the plugin that it will never runs multiple-instances at the same time (bulkedit)?
I tried a
private static Object _lockObject = new Object();
.
.
.
lock(_lockObject)
{
//here is my code....
}
but It didn't work. I ran in a endless loop I think ;)
thanks a lot
Tobias