Unanswered Workaround for TimeoutException

  • Monday, April 11, 2011 7:13 PM
     
     

    Currently facing an issue, where the Microsoft.SharePoint.Taxonomy.TermStore.CommitAll() fails with a System.TimeoutException, after which all other CommitAll() operations afterwards then fail with TermStoreOperationException:  Failed to read or write to database...

    How should the TimeoutException be handled, so additional Taxonomy updates can be made; without restarting the entire update process?

All Replies

  • Sunday, May 08, 2011 6:12 PM
     
     

    I have been getting the same exact issue in my Opensource project: http://taxomatic.codeplex.com. To summarize: I have built an opensource tool that exports and imports taxonomy via XML files. It generates a lot of database updates becuase the the old taxonomy is completely destroyed and then rebuit from the uploaded XML file.

    When testing with small taxonomy XML files I do not get this exception. However, a large taxonomy XML file causes the database to timeout with the following exception:

    Microsoft.SharePoint.Taxonomy.TermStoreOperationException: Failed to read from or write to database. Refresh and try again.

    Searching MSDN and on the web has not yielded any workarounds yet. I am trying to put in some delays by causing the thread to sleep in between updates without much success. At this point, it is a case of trial and error and I will post a solution or workaround if I find one.


    -- With Regards Shailen Sukul Entrepreneur/Software Architect/Developer/Consultant/Trainer (BSc | Mct | Mcpd (.Net 2/3.5) | Mcts (Sharepoint 2010/MOSS/WSS), Biztalk, Web, Win, Dist Apps) | Mcitp(SharePoint) | Mcsd.NET | Mcsd | Mcad) MSN | Skype | GTalk Id: shailensukul Twitter: http://twitter.com/shailensukul Ph: +1 916 359-9557 Website: http://sukul.org Blog: http://shailen.sukul.org/ http://www.linkedin.com/in/shailensukul http://www.facebook.com/shailen.sukul
  • Sunday, May 08, 2011 11:35 PM
     
     

    The only workaround is to CommitAll often, we are adding a Term store using the USGS GNIS (http://geonames.usgs.gov/domestic/download_data.htm), these FedCodes represent State,County, & City Taxonomy as well as Lat/Long for cities which is stored in the Terms properites.  This simple 5M zip file becomes a 422M MMS database.  This import utility also creates a Term Set with States at the first level, but reuses county Terms from the generated State Term Sets.  This was necessary because Term Set  guidance limits 30000 Items, but to use the Managed Metadata field require selecting a single Term Set.  TimeoutException happens when resusing county Terms as well, the simple fix execute CommitAll on every reused term.

    As far as I can tell using CommitAll often only slows down import, but at least it works.

  • Monday, May 09, 2011 1:59 AM
     
     

    This does not work for me. I have a large XML taxonomy file which contains multiple term stores, groups, termsets and terms that are multiple levels deep. I have put CommitAll on every single line which does a Term update including Groups and Termsets. I always end up with the following error message:

    Microsoft.SharePoint.Taxonomy.TermStoreOperationException: Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator. at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2c.b__2b() at Microsoft.Office.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2c.b__2a() at Microsoft.Office.Server.Utilities.MonitoredScopeWrapper.RunWithMonitoredScope(Action code) at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.RunOnChannel(CodeToRun codeToRun, Double operationTimeoutFactor) at Microsoft.SharePoint.Taxonomy.Internal.TaxonomyProxyAccess.Write(String data) at Microsoft.SharePoint.Taxonomy.Internal.Sandbox.CommitSandbox() at Microsoft.SharePoint.Taxonomy.TermStore.CommitAll() at Sukul.SharePoint.Taxomatic.Service.TaxonomyHelper.ImportTaxonomy(String xmlFileName) --- End of inner exception stack trace


    -- With Regards Shailen Sukul Entrepreneur/Software Architect/Developer/Consultant/Trainer (BSc | Mct | Mcpd (.Net 2/3.5) | Mcts (Sharepoint 2010/MOSS/WSS), Biztalk, Web, Win, Dist Apps) | Mcitp(SharePoint) | Mcsd.NET | Mcsd | Mcad) MSN | Skype | GTalk Id: shailensukul Twitter: http://twitter.com/shailensukul Ph: +1 916 359-9557 Website: http://sukul.org Blog: http://shailen.sukul.org/ http://www.linkedin.com/in/shailensukul http://www.facebook.com/shailen.sukul
  • Tuesday, May 10, 2011 10:44 AM
     
     

    The TermStoreOperationException will occur only after the TimeoutException?

    Our import utility uses a predefined Term Store & Group.  Then creates a Term Set for each of the files contained inside the zip file, if it does not already exist.

    The next step will update exisiting Terms in the Term Set.

    All of the first level Terms (Counties) are created before the first CommitAll(), unless updates too existing Terms have already occurred.

    The second level (Cities) are added using the CommitAll() for each term.

    When all cities for the State Term Set have been completed, each of the first level county Terms are reused in another Term Set, the CommitAll() is called for each reused Term, to avoid TimeoutException.

    We have found that after the TimeoutException nothing will work afterwards, short of creating another TaxonomySession.

    With you using a large XML file, unsure if it would be possible to just commit first level terms first, then commit second level, then third,  . . . , the seventh level (maximum level allowed).

    Hope this helps.