是的Active Directory事务感知? [英] Is Active Directory transaction-aware?

查看:210
本文介绍了是的Active Directory事务感知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题,但我无法找到答案的任何地方:是的Active Directory事务感知

Simple question but I can't find the answer anywhere: is Active Directory transaction-aware?

在换句话说,将下面的变化来回滚(因为我没有叫 scope.Complete()):

In other words, will the following change be rolled back (since I didn't call scope.Complete()):

using (var scope = new TransactionScope())
{
    DirectoryEntry entry = ...;
    entry.Properties["givenName"].Value = "New Given Name";
    entry.CommitChanges();
}

如果没有,是否有可能使这个不知何故?现在我有code,执行数据库更新和相应的广告更新,我已经补偿的逻辑为AD的更新,如果他们以某种方式失败。这个解决方案是远非最佳

If not, is it possible to enable this somehow? Right now I have code that performs database updates and corresponding AD updates and I have compensating logic for the AD updates if they somehow fail. This solution is far from optimal.

亲切的问候, 罗纳德·Wildenberg先生

Kind regards, Ronald Wildenberg

推荐答案

简短的答案是 - 没有。 ActiveDirectory的本质上是一个LDAP实现(有一些奇特的扩展,但它的核心仍然是LDAP)。无论是LDAP协议,也没有规范有交易的概念,所以这真的是不可能的。

Short answer is - no. ActiveDirectory is essentially an LDAP implementation (with some fancy extensions but at it's core it is still LDAP). Neither the LDAP protocols nor the specs have the concept of transactions so this really isn't possible.

这将有可能效仿交易在客户端上,但你必须做你自己或使用弹簧,我相信会为你做的 - 显然,这是不是安全的,因为服务器端的事务,你' ð期望从一个数据库。在春天的说明 - 我不能完全肯定Spring.NET支持LDAP的'交易'但,但他们有类似的东西在Java实现的弹簧。这可能是值得一试。

It would be possible to emulate transactions on the client side but you'd have to do that yourself or use Spring which, I believe, will do that for you - obviously this is not as safe as server side transactions that you'd expect from a DB. A note on Spring - I'm not completely sure that Spring.NET supports 'transactions' for LDAP yet but they have something like that in the Java implementation of Spring. It might be worth a look.

从阅读文档上的CommitChanges方法,它只是说,它会将您更改服务器 - 如果不做出点说,他们是交易安全的我会认为他们不是

From reading the docs on the CommitChanges method it just says that it sends your changes to the server - if it doesn't make a point of saying that they are transaction safe I would assume that they're not.

一些随机的想法 - 我的的猜测的,有可能是微软可能会增加这样的事情到ActiveDirectory的(因为它超过的只是的LDAP),但他们可能赢得 ■如果他们还没有。

Some random thoughts - I guess it would be possible that Microsoft could add something like this onto ActiveDirectory (as it is more than just LDAP) but they probably won't if they haven't yet.

这篇关于是的Active Directory事务感知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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