I have an event reciever with ItemDeleting action, in which i try to delete an item from another list (I cant realy use cascade delet behavior here, I need to do some stuff that requires the receiver). The problem is, the code deleting the item executes for like 2 minutes, doesnt matter if I use SPListItem.Delete() or ProcessBatchData(). The receiver runs synchronously (thats actually a second problem - I can't change it to run async, which should be default...). The same code (item deleting) runs normally (fast) in a test, so I dont think there is anything wrong with it. Just posting Elements.xml of my receiver, hoping maybe this will help to see the issue:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListUrl="Lists/MyList">
<Receiver>
<Name>SomethingItemDeleting</Name>
<Type>ItemDeleting</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>My.Class.SomethingReceiver.SomethingReceiver</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
Edit: The code that executes so long is basically
_web.ProcessBatchData(batch);
Where batch is:
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><ows:Batch OnError=\"Continue\"><Method><SetList Scope=\"Request\">e8bccd77-2a29-49f4-81b9-a7909babd3b6</SetList><SetVar Name=\"ID\">2487</SetVar><SetVar Name=\"Cmd\">Delete</SetVar></Method></ows:Batch>";
The same code outside the receiver executes in like 2 seconds. The same is when I run SPListItem.Delete(). The list from which the item is being deleted contains about 50 items (they are in 2-level folder hierarchy) and has no event receivers of its own