Sharepoint solutions

May 13, 2008

Transactions in Sharepoint 2007

Filed under: main — admin @ 12:59 am

During the development the application in  sharepoint we made some operations  with the list items that must be proccessed as “all-or-nothing”,  such moving the item in the list and then change it field, or update multiple items simultaneously. Object model of the Sharepoint services does not contain methods that deal with transaction. So, I begin my researches and find some forum post http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2873895&SiteID=1. Moderator refers to
http://support.microsoft.com/kb/883316 and said that Sharepoint object model does not support transaction. I have read early some other posts that suggested to use Service Without Components http://weblogs.asp.net/paolopia/archive/2005/01/30/363312.aspx or http://msmvps.com/blogs/anguslogan/archive/2005/07/19/58191.aspx

and also to use new TransactionScope class http://www.eggheadcafe.com/software/aspnet/31533974/sharepoint-om–transacti.aspx. I try to use  Service Without Components or TransactionScope class but they did not work for me. So, the reference to Microsoft KB and argument that distributed transaction are based on com+ technology seems to be convincing and it is no way to use transaction simply in Sharepoint OM.

 But moderators that object to use transation in OM suggest to use WF in Sharepoint instead. It seems to me strange and I continue my reasearches.  I found interesting post http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1993200&SiteID=1 that refers to http://msdn2.microsoft.com/en-us/library/ms442249.aspx.  msdn said that Windows SharePoint Services-specific workflow activities are  batched and not committed until a commit point is reached but code activities are committed as they occur. But most of the SharePoint Services-specific workflow activities can not be  developed with Visual Studio,  only With Sarepoint Designer. So, I search again and  find another interested article http://blogs.msdn.com/sharepointdesigner/archive/2007/07/06/porting-sharepoint-designer-workflows-to-visual-studio.aspx  that teaches to use SD workflow in VS.

2 Comments

  1. I try to check rollback in SPD sharepoint workflow and see that there is not any transaction in update list item action. See my post http://forums.microsoft.com/msdn/ShowPost.aspx?siteid=1&postid=3583553 for more information.

    Comment by admin — July 8, 2008 @ 12:00 pm

  2. COM+ Transactions worked fine for SP2003. In MOSS 2007 you have to do the compensation yourself for any action done using the OM. The workflows architecture has been designed with this in mind. Never the less, You must write the code in the compensation handler for this to work.

    Comment by Lennin Arriola — February 18, 2009 @ 5:36 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress