Bug in Drop11: fixed guid for WebAppSettingStore

May 28, 2010 at 10:07 AM

Hi,

the WebAppSettingStore uses a fixed guid for all instances. This doesn't work if you have multiple web applications (results in duplicate IDs for SPPersistedObject).

The Load-Method should be changed to:

                settingStore = new WebAppSettingStore(WebAppSettingStore.StoreName, webApp, Guid.NewGuid());

tobey

Coordinator
May 28, 2010 at 12:45 PM

Thanks Tobey for the feedback.  The documentation is unclear if this needs to be unique within the parent's scope or the entire scope, but regardless, we aren't really using it so I moved this to use the constructor that doesn't specify a GUID at all to eliminate the possibility.  Did you have an issue in an environment with multiple web apps?

Chris

May 28, 2010 at 12:55 PM

Hi,

I could only manage configuration for one web application (the one that created the setting store first). For every other web application I get an exception (duplicate SPPersistedObject ID). I think the id has to be unique for the entire farm (regardless of the parent).

tobey

 

Coordinator
May 28, 2010 at 1:04 PM

Thanks Tobey, good to know for the future.   I took out the GUID and updated the constructors.  Here are the changes that were made to the constructor (I tested with my set of integration tests, but not with multiple web apps yet), but you can also make the change and see if you hit any issues if you have a chance:

Changed both the WebAppSettingStore and FarmSettingStore (for consistency) from:

 public FarmSettingStore(string name, SPPersistedObject parent, Guid id)
            : base(name, parent, id)
        {

        }

 TO:

public FarmSettingStore(string name, SPPersistedObject parent):

base(name, parent)

{

}