castle 1.0 RC1 中使用“自动事务”facility后,并发较大的情况下,造成创建proxy失败
是因为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中的实现,这样肯定就不会出现问题了。