Hi,
I'm aware that Prior to NHibernate 1.2.0Beta 2 there was a race condition caused by the Castle.DynamicProxy. This issue was tracked as
http://jira.nhibernate.org:8080/jira/browse/NH-782 . *However* I'm running NHibernate 1.2.0GA and under load for one of the method calls in the system (this is particularly odd, most things work great, but just one method causes this exception!) . I have seen this error in my logs.
I've checked, and checked again the Castle.DynamicProxy assembly thats in use, and ignoring the version numbers which seem unreliable, the DLL I'm using is 77,824 bytes big and has an MD5 HASH of C0DAC2B752F6B2FDADB7F6DB8004C16C which matches the properties of the DLL shipped with both 1.2.0GA and 1.2.1GA (but doesn't match the latest stable 1.1.5 assembly provided by the castle project)
Does anyone out there have any clue as to how I can be experiencing this issue on the version I'm using (see below). Unfortunately I've not been able to replicate the issue directly in a test scenario, it only occurs on a heavily loaded live environment.
In this environment there are multiple Application Domains on the same physical system (and IIS instance) using the same SessionFactory configurations (but different instances of the SessionFactory, one per Application Domain). Is it possible something's happening with temporary files or some-such ?
NHibernate version:
1.2.0GA
Full stack trace of any exception that occurs:
System.ArgumentException: Duplicate type name within an assembly.
at System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
at System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, Module module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineTypeNoLock(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at Castle.DynamicProxy.Builder.CodeBuilder.EasyType..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, Boolean serializable)
at Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator.CreateTypeBuilder(String typeName, Type baseType, Type[] interfaces)
at Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass, Type[]interfaces)
at Castle.DynamicProxy.Builder.DefaultProxyBuilder.CreateClassProxy(Type theClass, Type[] interfaces)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type baseClass, Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, Object[] argumentsForConstructor)
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
Name and version of the database you are using:
SQL Server 2005