ADAM/AzMan 中的并发更新引发奇怪的错误

发布于 2024-10-07 12:05:32 字数 503 浏览 8 评论 0原文

我们有一个使用 WCF 服务和 ADAM/AzMan 的自定义成员资格提供程序。最近我们看到了很多错误,这似乎与我们的网络应用程序的大量使用相对应。

我发现在 Web 应用程序中,每次用户登录时都会对管理员帐户进行更新。

在大量使用情况下,似乎有两个不同的进程正在尝试更新管理员帐户中的配置文件信息。我看到的错误是:

COMException - Cannot create a file when that file already exists.

这是来自 AzMan。

我的问题是:尝试对 ADAM/AzMan 中的同一条记录(甚至同一个 ADAM 实例)进行并发更新是否会引发错误,并且该错误是否高于我应该预期的错误?

编辑我们删除了不断更新管理员帐户的代码,这显着减少了错误。我们仍然偶尔会遇到错误。我们有多个应用程序都使用相同的 ADAM 实例。如果其中多个应用程序尝试更新 ADAM 中的数据,这会导致问题吗?

We have a custom membership provider that uses a WCF service and ADAM/AzMan. We have been seeing a lot of errors lately which seems to correspond to more heavy use of our web aplication.

I discovered that in the web application each time a user logs in an update is being made to the Administrators account.

Under heavy use it looks like two different processes are trying to update profile information in the Adminitrators account. The error I am seeing is:

COMException - Cannot create a file when that file already exists.

This is coming from AzMan.

My question is: Is attempting concurrent updates on the same record (or even just the same ADAM instance) in ADAM/AzMan going to throw an error and is the error above the error I should expect?

EDIT We have removed the code that was constantly updating the admin account and this has significantly reduced the errors. We still run into an error once in a while. We have several applications that all use the same ADAM instance. If several of these apps attempt to update data within ADAM can this casue a problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁的新欢旧爱 2024-10-14 12:05:32

如何阅读此处

中的授权管理器没有
当策略是时支持并发
存储在 XML 中

授权管理器确实可以利用
Active Directory 支持
并发。活动目录和 ADAM
有一个非交易模型
支持并发添加和
多值或链接的减法
对象属性。在活动目录中
和 ADAM,对象属性的更改
是原子的(在属性级别)所以
你永远不会有一个属性
两个变化的网格。活动目录
使用“最后写入者获胜”机制
确定哪个写请求将
坚持。属性永远不会合并;
一个写请求(最后一次写
收到)将永远获胜。对于AD
链接属性(例如
授权经理角色和组
会员资格或之间的链接
操作、任务和角色
定义)变化是附加的;所以
同时加或减
用户或链接和取消链接
操作、任务和角色是
支持。然而,授权
Manager MMC 管理单元 UI 维护
未更新的客户端缓存
当商店从某些更改时
其他用户界面或应用程序;所以,
需要多个的应用程序
并发管理员需要
自定义用户界面。


我个人更喜欢使用 SQL Server 作为授权管理器策略存储。如果您创建一个新的基于 SQL 的策略存储并查看相应数据库的内部,您将在几乎所有表中看到 timestamp 类型的 RowUpdateTimeStamp 列。更重要的是,许多表都有额外的 binary(8) 类型的 ChildUpdateTimeStamp 列和 XX_UpdateParentTimeStampOnXXX 触发器。所有这些都表明,至少基于 SQL 的授权管理器策略存储旨在支持并发。问题只是这部分没有真正记录下来,并且不清楚到底会收到哪些错误/异常。

再说一点。如果您尚未使用 IAzAuthorizationStore::UpdateCache您可以考虑在 AzMan 商店中进行更改之前使用它。

How you can read here

Authorization Manager in does not
support concurrency when policy is
stored in XML
.

Authorization Manager does leverage
Active Directory for support for
concurrency. Active Directory and ADAM
have a non-transactional model that
supports concurrent additions and
subtraction
of multi-valued or linked
object attributes. In Active Directory
and ADAM, changes to object attributes
are atomic (at the attribute level) so
you never have an attribute that is a
mesh of two changes. Active Directory
uses a "last writer wins" mechanism to
determine which write request will
persist. Attributes are never merged;
one write request (the last write
received) will always win. For AD
linked attributes (such as
Authorization Manager role and group
memberships, or links between
operations, tasks, and role
definitions) changes are additive; so
concurrently adding or subtracting
users or linking and unlinking
operations, tasks, and roles is
supported. However, the Authorization
Manager MMC snap-in UI maintains a
client-side cache that is not updated
when the store is changed from some
other UI or application; therefore,
applications that require multiple
concurrent administrators require a
custom UI.

I personally prefer to use SQL Server as the Authorization Manager Policy Store. If you create a new SQL-based policy store and look inside of the corresponding database, you will see RowUpdateTimeStamp columns of the type timestamp in almost all of the tables. More then that, many tables have additional ChildUpdateTimeStamp column of binary(8) type and XX_UpdateParentTimeStampOnXXX triggers. All this show that at least SQL-based Authorization Manager Policy Store is designed to support concurrency. The problem is only that this part is not really documented and which errors/exceptions exactly one will receive is not clear.

One more remark. If you not yet use IAzAuthorizationStore::UpdateCache you can consider to use it before to made changes in the AzMan Store.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文