您的位置:首页 > 其它

castle 1.0 RC1 中使用“自动事务”facility后,并发较大的情况下,造成创建proxy失败

2008-05-20 11:22 459 查看
 

是因为1-1的castle使用的createcontext.empty的问题,

[Serializable]

public sealed class CreationContext : MarshalByRefObject, ISubDependencyResolver

{

/// <summary>Creates a new, empty <see cref="CreationContext" /> instance.</summary>

/// <remarks>A new CreationContext should be created every time, as the contexts keeps some state related to dependency resolution.</remarks>

public static CreationContext Empty

{

get { return new CreationContext(new DependencyModel[0]); }

}

在这个方法中RC1的版本使用每次返回同一个静态对象createcontext.empty,以上这段代码是新版本RC2中的实现,这样肯定就不会出现问题了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐