I am trying to delete multiple items in a sharepoint list. But the constraint is : either all the items should be deleted or not a single item should be deleted.In short I am looking for trasactional behavior in SharePoint.I tried to use ProcessBatchData() function. But it seems that it doesnt fulfill my requirement. Is there any other method exist to achieve the same?
"does webservice's processbatchdata() help?"
The ProcessBatchData is a method of the SPWeb class, and not a web service method:
And there is the web service-based Lists.UpdateListItems method, where you can also submit a batch of changes:
But basically you can use both methods to batch update list items.
No, it really does not help. These methods are no more than what they say: they help you run batches, not transactions. You can set the batch to return on error, but it won't rollback former successful modifications.
To have some kind of "transaction" you have to create your own compensation based implementation, for example, you have to try to set the original values of updated items, delete created items, restore deleted items, etc. That sounds not easy.
More on the batch updates:
SPWeb.ProcessBatchData. A list is a list is a list?
Batch Updating List Items in Windows SharePoint Services 3.0