Microsoft KB Archive/300389

= CacheManager Causes Corruption in Category Dictionary =

Article ID: 300389

Article Last Modified on 2/28/2007

-

APPLIES TO


 * Microsoft SharePoint Portal Server 2001

-



This article was previously published under Q300389



SYMPTOMS
When you check in a document or assign categories in the properties of a document, an incorrect category dictionary may be displayed. The category dictionary may contain some or all of the categories from a separate workspace on the same server. However, the category hierarchy is displayed properly when you browse through categories in the dashboard site or in Web folders.



CAUSE
The CacheManager in SharePoint Portal Server caches data on both the server and client to improve performance. This problem can occur if, under certain conditions, the Web Storage System (WSS) is down, the CacheManager shows the same data for different workspaces. This type of cache corruption most often occurs in the category dictionary.



RESOLUTION
First run the following scripts, Getcatdict.vbs and Querycats.vbs, to determine if the category dictionary in the workspace is corrupted.

IMPORTANT: The following scripts must be run by a user with workspace Coordinator permissions.

Diagnosing Category Dictionary Corruption
To diagnose category dictionary corruption:   Save the following script to a text file as Getcatdict.vbs. const adModeRead       =   1 const adModeReadWrite  =       3

Sub Usage WScript.Echo &quot;Use PKMCDO to list the category dictionary in WSS.&quot; WScript.Echo WScript.Echo &quot;Usage:   getcatdict.vbs &quot;&quot;&quot;&quot;&quot; WScript.Echo &quot;Example: getcatdict.vbs &quot;&quot;http://servername/workspacename&quot;&quot;&quot; WScript.Echo end Sub

call main

sub main

if WScript.Arguments.Count = 1 then if WScript.Arguments(0) = &quot;/?&quot; or WScript.Arguments(0) = &quot;-?&quot; then Usage WScript.Quit(1) end if   end if

if WScript.Arguments.Count < 1 then Usage wscript.Quit(1) end if

strDoc = wscript.arguments(0) & &quot;/system/schema/d_categories.xml&quot;

Set oDoc = createobject(&quot;CDO.KnowledgeDocument&quot;) oDoc.DataSource.Open strDoc, Nothing, adModeRead dictCats = oDoc.Property(&quot;urn:schemas-microsoft-com:publishing:dictionaryvalues&quot;) Wscript.echo &quot;Category dictionary for &quot; & wscript.arguments(0) & &quot;:&quot; for i = 0 to UBound(dictCats,1) wscript.echo dictCats(i) next

end sub Run the following command from a command prompt on the server:

getcatdict.vbs &quot;http:// / &quot;

This script retrieves the category dictionary from a SharePoint Portal Server workspace. The category dictionary is defined by the urn:schemas-microsoft-com:publishing:dictionaryvalues property. The CacheManager can corrupt a workspace's category dictionary by committing (saving) the category dictionary from one workspace to the category dictionary for another workspace.   Save the following script to a text file as Querycats.vbs. const adModeRead       =   1 const adModeReadWrite  =       3 const  cdostrURI_CategoriesFolder      =   &quot;urn:schemas-microsoft-com:workspace#CategoriesFolder&quot;

'+ ' ' Member:      Sub Usage ' ' Synopsis:    Prints help ' ' Effects: ' ' Arguments: ' ' Returns: ' ' History:     01-06-2001                  Created ' ' Notes: ' ' Sub Usage WScript.Echo &quot;Queries WSS for the categories.&quot; WScript.Echo WScript.Echo &quot;Usage:   querycats.vbs &quot;&quot;&quot;&quot;&quot; WScript.Echo &quot;Example: querycats.vbs &quot;&quot;http://servername/workspacename&quot;&quot;&quot; WScript.Echo end Sub

call main

'+ ' ' Member:      Sub Main ' ' Synopsis:    Main entry pt ' ' Effects: ' ' Arguments: ' ' Returns: ' ' History:     01-06-2001                  Created ' ' Notes: ' ' sub main

Dim oRS Dim strCatsName Dim strCatsURL Dim strCmd

if WScript.Arguments.Count = 1 then if WScript.Arguments(0) = &quot;/?&quot; or WScript.Arguments(0) = &quot;-?&quot; then Usage WScript.Quit(1) end if   end if

if WScript.Arguments.Count < 1 then Usage wscript.Quit(1) end if

strCatsName = GetPropUsingPKMCDO(wscript.arguments(0), cdostrURI_CategoriesFolder, true) strCatsURL = wscript.arguments(0) & &quot;/&quot; & strCatsName strCmd = &quot;select &quot;&quot;urn:schemas-microsoft-com:office:office#Category&quot;&quot; from scope ('DEEP TRAVERSAL OF &quot;&quot;&quot; & strCatsURL & &quot;&quot;&quot;') WHERE &quot;&quot;DAV:contentclass&quot;&quot; = 'urn:content-classes:categoryfolder'&quot; Set oRS = ExecuteDBCmd(&quot;ADODB.Connection&quot;, &quot;MSDAIPP.DSO&quot;, &quot;ADODB.Command&quot;, strCmd, strCatsURL)

Dim rgCat cnt=0

If Not oRS.BOF Then oRS.MoveFirst Redim rgCat(1) While Not oRS.EOF Redim preserve rgCat(cnt) rgCat(cnt) = oRS.fields(&quot;urn:schemas-microsoft-com:office:office#Category&quot;).Value cnt = cnt+1 oRS.MoveNext Wend end if

Wscript.echo &quot;Categories for &quot; & wscript.arguments(0) & &quot; from WSS:&quot; for i = 0 to UBound(rgCat,1) wscript.echo rgCat(i) next

end sub

'+ ' ' Member:      Function ExecuteDBCmd ' ' Synopsis:    Executes the command ' ' Effects: ' ' Arguments:   strConnectionObj:   Connection object to instantiate and use '              strProviderObj:     Provider object to use '              strCommandObj:      Command object to use '              strCmdText:         The command '              strURL:             The URL ' ' Returns:     The RecordSet from the execution of the command ' ' History:     01-06-2001                  Created ' ' Notes: ' ' Function ExecuteDBCmd(strConnectionObj, strProviderObj, strCommandObj, strCmdText, strURL)

Dim oCon Dim oCmd Dim oRS

Set oCon = CreateObject(strConnectionObj)

oCon.Provider = strProviderObj

oCon.Open strURL

Set oCmd = CreateObject(strCommandObj)

oCmd.ActiveConnection = oCon

oCmd.CommandText = strCmdText

Set oRS = oCmd.Execute

Set oCmd = Nothing Set oCon = Nothing

Set ExecuteDBCmd = oRS

end Function

'+ ' ' Member:      Function GetPropUsingPKMCDO ' ' Synopsis:    Gets the property from the row using PKMCDO ' ' Effects: ' ' Arguments:   strURL:  URL to bind to '               strProp: URI to get '              fLog: Log failures? ' ' Returns:     Array collection of categories for this workspace. '              The array returned can be empty. ' ' History:     01-06-2001                  Created ' ' Notes: ' '- Function GetPropUsingPKMCDO(strURL, strProp, fLog) Dim oDoc Dim oCon

Set oDoc = CreateObject(&quot;CDO.KnowledgeDocument&quot;)

Set oCon = CreateObject(&quot;ADODB.Connection&quot;) oCon.Provider = &quot;MSDAIPP.DSO&quot;

oCon.Open &quot;Provider=MSDAIPP.DSO; Data Source=&quot; + strURL

oDoc.DataSource.Open strURL, oCon, adModeRead

GetPropUsingPKMCDO = oDoc.Property(strProp)

Set oDoc = Nothing Set oCon = Nothing

end Function Run the following command from a command prompt on the server:

querycats.vbs &quot;http:// / &quot;

This script queries the WSS for the list of categories from &quot;http:// / /Categories.&quot; The list of categories is the same as the list that is displayed when you browse through the category folders from the dashboard site or from Web folders.  Compare the output of each script. If the categories that are listed from the Querycats.vbs and Getcatdict.vbs scripts are not identical, the category dictionary is corrupted.

If the category dictionary is not corrupted (both scripts return the same values), an available fix is described in the &quot;Applying the Fix&quot; section of this article that prevents cache corruption from occurring.

If the category dictionary is corrupted (the scripts return different values), you must first repair the corrupted dictionary, and then apply the fix to prevent the issue from re-occurring.

Repairing the Corrupted Dictionary
To repair a corrupted dictionary:   Save the following script to a text file as Verifycatdict.vbs. const adModeRead       =   1 const adModeReadWrite  =       3 const  cdostrURI_CategoriesFolder      =   &quot;urn:schemas-microsoft-com:workspace#CategoriesFolder&quot;

'+ ' ' Member:      Sub Usage ' ' Synopsis:    Prints help ' ' Effects: ' ' Arguments: ' ' Returns: ' ' History:     01-06-2001                  Created ' ' Notes: ' ' Sub Usage WScript.Echo &quot;Displays the category dictionary from WSS (i.e., not from the cahce).&quot; WScript.Echo WScript.Echo &quot;Usage:   verifycatdict.vbs &quot;&quot;<http url to your workspace>&quot;&quot;&quot; WScript.Echo &quot;Example: verifycatdict.vbs &quot;&quot;http://servername/workspacename&quot;&quot;&quot; WScript.Echo end Sub

call main

'+ ' ' Member:      Sub Main ' ' Synopsis:    Main entry pt ' ' Effects: ' ' Arguments: ' ' Returns: ' ' History:     01-06-2001                  Created ' ' Notes: ' ' sub main

Dim oRS Dim strCatsName Dim strCatsURL Dim strCmd

if WScript.Arguments.Count = 1 then if WScript.Arguments(0) = &quot;/?&quot; or WScript.Arguments(0) = &quot;-?&quot; then Usage WScript.Quit(1) end if   end if

if WScript.Arguments.Count < 1 then Usage wscript.Quit(1) end if

strCatsName = GetPropUsingPKMCDO(wscript.arguments(0), cdostrURI_CategoriesFolder, true) strCatsURL = wscript.arguments(0) & &quot;/&quot; & strCatsName strCmd = &quot;select &quot;&quot;urn:schemas-microsoft-com:office:office#Category&quot;&quot; from scope ('DEEP TRAVERSAL OF &quot;&quot;&quot; & strCatsURL & &quot;&quot;&quot;') WHERE &quot;&quot;DAV:contentclass&quot;&quot; = 'urn:content-classes:categoryfolder'&quot; Set oRS = ExecuteDBCmd(&quot;ADODB.Connection&quot;, &quot;MSDAIPP.DSO&quot;, &quot;ADODB.Command&quot;, strCmd, strCatsURL)

Dim rgCat cnt=0

If Not oRS.BOF Then oRS.MoveFirst Redim rgCat(1) While Not oRS.EOF Redim preserve rgCat(cnt) rgCat(cnt) = oRS.fields(&quot;urn:schemas-microsoft-com:office:office#Category&quot;).Value cnt = cnt+1 oRS.MoveNext Wend end if

Wscript.echo &quot;Categories for &quot; & wscript.arguments(0) & &quot; from WSS (not from the cache):&quot; for i = 0 to UBound(rgCat,1) wscript.echo rgCat(i) next Wscript.echo Wscript.echo &quot;Attempting to write the categories to WSS&quot; Wscript.echo

Set oRec = CreateObject(&quot;ADODB.Record&quot;) oRec.Open wscript.arguments(0) & &quot;/system/schema/d_categories.xml&quot;, &quot;url=&quot; & wscript.arguments(0) & &quot;/system/schema/d_categories.xml&quot;, 3 oRec.Fields(&quot;urn:schemas-microsoft-com:publishing:dictionaryvalues&quot;) = rgCat oRec.Fields.Update

Wscript.echo &quot;Successfully saved the categories to WSS&quot;

end sub

'+ ' ' Member:      Function ExecuteDBCmd ' ' Synopsis:    Executes the command ' ' Effects: ' ' Arguments:   strConnectionObj:   Connection object to instantiate and use '              strProviderObj:     Provider object to use '              strCommandObj:      Command object to use '              strCmdText:         The command '              strURL:             The URL ' ' Returns:     The RecordSet from the execution of the command ' ' History:     01-06-2001                  Created ' ' Notes: ' ' Function ExecuteDBCmd(strConnectionObj, strProviderObj, strCommandObj, strCmdText, strURL)

Dim oCon Dim oCmd Dim oRS

Set oCon = CreateObject(strConnectionObj)

oCon.Provider = strProviderObj

oCon.Open strURL

Set oCmd = CreateObject(strCommandObj)

oCmd.ActiveConnection = oCon

oCmd.CommandText = strCmdText

Set oRS = oCmd.Execute

Set oCmd = Nothing Set oCon = Nothing

Set ExecuteDBCmd = oRS

end Function

'+ ' ' Member:      Function GetPropUsingPKMCDO ' ' Synopsis:    Gets the property from the row using PKMCDO ' ' Effects: ' ' Arguments:   strURL:  URL to bind to '               strProp: URI to get '              fLog: Log failures? ' ' Returns:     Array collection of categories for this workspace. '              The array returned can be empty. ' ' History:     01-06-2001                  Created ' ' Notes: ' '- Function GetPropUsingPKMCDO(strURL, strProp, fLog) Dim oDoc Dim oCon

Set oDoc = CreateObject(&quot;CDO.KnowledgeDocument&quot;)

Set oCon = CreateObject(&quot;ADODB.Connection&quot;) oCon.Provider = &quot;MSDAIPP.DSO&quot;

oCon.Open &quot;Provider=MSDAIPP.DSO; Data Source=&quot; + strURL

oDoc.DataSource.Open strURL, oCon, adModeRead

GetPropUsingPKMCDO = oDoc.Property(strProp)

Set oDoc = Nothing Set oCon = Nothing

end Function Run the following command from a command prompt on the server:

verifycatdict.vbs &quot;http:// / &quot;

</li> Follow steps 1 through 3 in the &quot;Diagnosing Category Dictionary Corruption&quot; section of this article to verify that the list of categories from Querycats.vbs and Getcatdict.vbs are now identical.</li> At this point, the corruption is fixed; however, the corrupted information may still exist in the cache on the server and client computers. If you restart the server, you update the cache with the correct information. If clients continue to see corrupted information, restart the clients as well.</li> Apply the fix that is described in the &quot;Applying the Fix&quot; section of this article.</li></ol>

Applying the Fix
To resolve this problem, obtain the latest service pack for SharePoint Portal Server 2001. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

312963 How to Obtain the Latest SharePoint Portal Server 2001 Service Pack

The English version of this feature should have the following file attributes or later:

<div class="status_section">

STATUS
This problem was first corrected in SharePoint Portal Server 2001 Service Pack 1.

Additional query words: SPS

Keywords: kbhotfixserver kbqfe kbbug kbfix kbshareptportalsvr2001presp1fix kbshareptportalsvr2001sp1fix KB300389

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.