从/向分层对象存储读取/写入-SharePoint 2007 [英] Read/Write from/to Hierarchical Object Store - SharePoint 2007

查看:137
本文介绍了从/向分层对象存储读取/写入-SharePoint 2007的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个自定义计时器作业,该作业需要一些配置才能运行.我正在尝试将配置另存为分层对象存储中的SPPersistedObject.

I've created a custom timer job which has requires some configurations to run. I'm trying to save the configurations as an SPPersistedObject in hierarchical object store.

分层对象存储保存在SharePoint配置数据库中,因此在尝试以SPWebApplication作为父级保存它时出现安全错误".

Hierarchical object store is saved in the SharePoint configuration database and hence I'm getting 'Security Error' while trying to save it with a SPWebApplication as the parent.

我什至尝试了提升特权,但是它没有帮助,因为它只是当前Web应用程序的应用程序池帐户,不需要访问SharePoint配置数据库.

I've even tried elevating the privileges but it dint help because it is just the application pool account for the current web application and it is not necessary for it to have the access to the SharePoint config database.

有什么想法吗?

推荐答案

您已经发现层次对象存储(HOS)存储在配置数据库中,而不是内容数据库中.

As you've found the hierarchical object store (HOS) is stored in the configuration database, not the content database.

如果您在除中央管理员之外的其他站点中运行,则应用程序池中的用户帐户使用

If you're running in the context of a site other than the central admin then the user account the application pool uses may not have permissions to Write to the configuration database.

这有点麻烦,因为您可能不会在开发人员安装上看到此消息(因为您可能没有使用应用程序池的域级别帐户(仅是网络服务)对其进行设置),并且只会跳闸当您开始生产时.

This is a bit of a doozy as you probably won't see this on a developer installation (as you probably won't have it setup with domain level accounts for app pools, only NETWORK SERVICE) and you will only trip up when you get to production.

注意-使用SPSecurity.RunWithElevatedPrivileges不会更改此设置,因为它只是从受限用户帐户升级到应用程序池帐户,而不是中央管理应用程序池帐户.

文章管理应用程序状态给出了选项的细分,并且它说到了居屋

The article Managing Application State gives a breakdown of the options and it says about the HOS

安全模型-用户需要 管理员权限来访问 相关的SharePoint对象(例如 SPFarm或SPWebApplication).

Security model - Users need administrator privileges to access the related SharePoint object (such as SPFarm or SPWebApplication).

由于这些原因,我认为居屋在现实世界中的使用非常有限,您最好使用Property Bag Storage模型,该模型可以在Farm/WebApp/Site和List级别存储设置:-

For these reasons I think the HOS is very limited in real world usage and you're better off using the Property Bag Storage model which can store settings at the Farm/WebApp/Site and List Levels :-

优势-可能是最 轻巧易用 配置存储选项.

Advantages - It is probably the most light-weight and easy to use of all the configuration storage options.

还报告了性能和稳定性的好处.

实际上, MSDN SharePoint指导库也使用属性包存储,以实现其层次结构 Configuration Manager .

In fact the MSDN SharePoint Guidance Library also uses the Property Bag storage for their implementation of a hierarchical Configuration Manager.

这篇关于从/向分层对象存储读取/写入-SharePoint 2007的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆